From baf3aad3e08db7e30bb39037e4e5d15f3ecd1d0e Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Wed, 7 Apr 2021 13:02:34 +0200 Subject: [PATCH] tests: Use current python interpreter for sub tests Can be useful to run tests using distro runtimes, (like python3 on Debian). Relate-to: https://github.com/theupdateframework/tuf/issues/263 Origin: https://salsa.debian.org/rzr/python-tuf/-/tree/debian/review/master Forwarded: https://github.com/theupdateframework/tuf/pull/1337 Signed-off-by: Philippe Coval --- tests/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index caccb18086..6a3ee66b1d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -25,6 +25,7 @@ import errno import logging import socket +import sys import time import subprocess import threading @@ -186,7 +187,7 @@ def _start_process(self, extra_cmd_args, popen_cwd): """Starts the process running the server.""" # The "-u" option forces stdin, stdout and stderr to be unbuffered. - command = ['python', '-u', self.server] + extra_cmd_args + command = [sys.executable, '-u', self.server] + extra_cmd_args # Reusing one subprocess in multiple tests, but split up the logs for each. self.__server_process = subprocess.Popen(command,