Skip to content

Commit

Permalink
In tests, use sys.executable instead of assuming "python" (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
musicinmybrain authored Sep 6, 2024
1 parent b373f38 commit b973d19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_scooby.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_import_os_error():
def test_import_time():
# Relevant for packages which provide a CLI:
# How long does it take to import?
cmd = ["time", "-f", "%U", "python", "-c", "import scooby"]
cmd = ["time", "-f", "%U", sys.executable, "-c", "import scooby"]
# Run it twice, just in case.
subprocess.run(cmd)
subprocess.run(cmd)
Expand Down Expand Up @@ -244,12 +244,12 @@ def rep_comp(inp):
assert rep_comp(test) == rep_comp(ret.stdout)

# version -- VIA scooby/__main__.py by calling the folder scooby.
ret = script_runner.run(['python', 'scooby', '--version'])
ret = script_runner.run([sys.executable, 'scooby', '--version'])
assert ret.success
assert "scooby v" in ret.stdout

# version -- VIA scooby/__main__.py by calling the file.
ret = script_runner.run(['python', os.path.join('scooby', '__main__.py'), '--version'])
ret = script_runner.run([sys.executable, os.path.join('scooby', '__main__.py'), '--version'])
assert ret.success
assert "scooby v" in ret.stdout

Expand Down

0 comments on commit b973d19

Please sign in to comment.