tests: Ignore warnings when running validation script

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-05-15 15:49:20 +02:00
parent d0e8472ab5
commit a33cb0bf91
1 changed files with 5 additions and 3 deletions

View File

@ -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)