From d254b0a32956f4e594ad0ddba84cf4c818936ae7 Mon Sep 17 00:00:00 2001 From: admeeer Date: Wed, 11 Oct 2023 13:59:08 -0700 Subject: [PATCH] ensure script and test_script use same interpreter --- tests/test_script.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_script.py b/tests/test_script.py index 1afac0d..ba42d20 100644 --- a/tests/test_script.py +++ b/tests/test_script.py @@ -1,9 +1,10 @@ # test_script.py import subprocess +import sys def test_script_output(capfd): - # run the script file under a new process - subprocess.run(['python', './script.py']) + # Run the script file under a new process using the same Python interpreter + subprocess.run([sys.executable, './script.py']) # Capture process output captured = capfd.readouterr()