Skip to content

Commit

Permalink
Run pytest as python -m pytest (#30)
Browse files Browse the repository at this point in the history
Sometimes, with multiple versions of Python, `pytest` on the path may
correspond to a different version of Python.
  • Loading branch information
stefanv authored Nov 30, 2022
2 parents f4c2974 + c7f0a77 commit 0032e3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion devpy/cmds/_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ def test(build_dir, pytest_args):
set_pythonpath(build_dir)

print(f'$ export PYTHONPATH="{site_path}"')
run(["pytest", f"--rootdir={site_path}"] + list(pytest_args), cwd=site_path)
run(
["python", "-m", "pytest", f"--rootdir={site_path}"] + list(pytest_args),
cwd=site_path,
)

0 comments on commit 0032e3d

Please sign in to comment.