tests: Use correct python version for config validation test

When tests are running using Py3, the script should be called with Py3
as well.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-12-04 14:14:30 +01:00
parent d5a0316877
commit e15a49defd

View File

@ -6,6 +6,8 @@ import os
import subprocess
import sys
import six
HERE = os.path.abspath(os.path.dirname(__file__))
BINDIR = os.path.join(HERE, '../bin')
@ -21,7 +23,8 @@ class ConfigValidateScriptTest(helpers.PungiTestCase):
@mock.patch('kobo.shortcuts.run')
def test_validate_dummy_config(self, run):
DUMMY_CONFIG = os.path.join(HERE, 'data/dummy-pungi.conf')
p = subprocess.Popen([PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG],
interp = 'python2' if six.PY2 else 'python3'
p = subprocess.Popen([interp, PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()