forked from theupdateframework/python-tuf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Use current python interpreter for sub tests
Applied-Upstream: theupdateframework#1337 Relate-to: theupdateframework#263 Signed-off-by: Philippe Coval <[email protected]>
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
debian/patches/0005-tests-Use-current-python-interpreter-for-sub-tests.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From: Philippe Coval <[email protected]> | ||
Date: Wed, 7 Apr 2021 13:02:34 +0200 | ||
Subject: 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 | ||
Forwarded: https://github.com/theupdateframework/tuf/pull/1337 | ||
Signed-off-by: Philippe Coval <[email protected]> | ||
--- | ||
tests/utils.py | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/tests/utils.py b/tests/utils.py | ||
index 8e8c07b..df43a23 100644 | ||
--- a/tests/utils.py | ||
+++ b/tests/utils.py | ||
@@ -25,6 +25,7 @@ from contextlib import contextmanager | ||
import errno | ||
import logging | ||
import socket | ||
+import sys | ||
import time | ||
import subprocess | ||
import threading | ||
@@ -200,7 +201,7 @@ class TestServerProcess(): | ||
"""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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters