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 <rzr@users.sf.net>
This commit is contained in:
Philippe Coval 2021-04-07 13:02:34 +02:00
parent 58b1a759c2
commit f00f89328e

View file

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