From a33cb0bf91e7c3e8db0baa14e812fd59a72c83aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 15 May 2019 15:49:20 +0200 Subject: [PATCH] tests: Ignore warnings when running validation script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script is run as a standalone process. Anything printed to stderr breaks the test. Since Python 3.8, we are getting warnings about invalid escape sequences in some modules that are imported but not owned by us. This patch should silence the warnings. Relates: https://bugzilla.redhat.com/show_bug.cgi?id=1698514 Signed-off-by: Lubomír Sedlář --- tests/test_config_validate_script.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_config_validate_script.py b/tests/test_config_validate_script.py index 031a15a4..0a0fd3ab 100644 --- a/tests/test_config_validate_script.py +++ b/tests/test_config_validate_script.py @@ -22,9 +22,11 @@ class ConfigValidateScriptTest(helpers.PungiTestCase): def test_validate_dummy_config(self): DUMMY_CONFIG = os.path.join(HERE, 'data/dummy-pungi.conf') interp = 'python2' if six.PY2 else 'python3' - p = subprocess.Popen([interp, PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + p = subprocess.Popen( + [interp, "-W", "ignore", PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) (stdout, stderr) = p.communicate() self.assertEqual(b'', stdout) self.assertEqual(b'', stderr)