From cbe8457377a3fd610796ea87a002e0eb02b02722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 16 May 2019 09:07:18 +0200 Subject: [PATCH] tests: Use correct Python interpreter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of guessing based on a good enough name, we can use `sys.executable` and get path to current python. Signed-off-by: Lubomír Sedlář --- tests/test_config_validate_script.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_config_validate_script.py b/tests/test_config_validate_script.py index 0a0fd3ab..bd6cfc9f 100644 --- a/tests/test_config_validate_script.py +++ b/tests/test_config_validate_script.py @@ -5,8 +5,6 @@ import os import subprocess import sys -import six - HERE = os.path.abspath(os.path.dirname(__file__)) BINDIR = os.path.join(HERE, '../bin') @@ -21,9 +19,8 @@ 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, "-W", "ignore", PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG], + [sys.executable, "-W", "ignore", PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG], stdout=subprocess.PIPE, stderr=subprocess.PIPE, )