From 5f8142e543bb3f5b948c246ca648327849e96faa Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 28 May 2021 13:27:10 +0200 Subject: tests: Make python_api_test.py always explicitly call Python This change makes it such that python_api_test.py will spawn a subprocess for multi_usrp_test.py by explicitly calling the Python interpreter, and making the path to multi_usrp_test.py the first argument. This fixes running this devtest after installing Python tests via ipks on embedded devices. --- host/tests/devtest/python_api_test.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'host/tests/devtest/python_api_test.py') diff --git a/host/tests/devtest/python_api_test.py b/host/tests/devtest/python_api_test.py index ef7a3ca1b..9cf168232 100644 --- a/host/tests/devtest/python_api_test.py +++ b/host/tests/devtest/python_api_test.py @@ -7,6 +7,7 @@ """ Test Python API """ import os +import sys from uhd_test_base import shell_application from uhd_test_base import UHDPythonTestCase @@ -19,17 +20,12 @@ class uhd_python_api_test(UHDPythonTestCase): Run test and report results. """ devtest_src_dir = os.getenv('_UHD_DEVTEST_SRC_DIR', '') - multi_usrp_test_path = \ - os.path.join(devtest_src_dir, 'multi_usrp_test.py') args = [ + os.path.join(devtest_src_dir, 'multi_usrp_test.py'), self.create_addr_args_str(), ] - app = None - if os.name == 'nt': - args.insert(0, multi_usrp_test_path) - app = shell_application('python') - else: - app = shell_application(multi_usrp_test_path) + # The 'app' we are running is just another Python process + app = shell_application(sys.executable) app.run(args) run_results = { 'return_code': app.returncode, -- cgit v1.2.3