Skip to content

Commit

Permalink
ensure script and test_script use same interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
admeeer committed Oct 11, 2023
1 parent 5061afe commit d254b0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_script.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit d254b0a

Please sign in to comment.