Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call pytest using "python -m pytest" #267

Merged
merged 2 commits into from
Jan 29, 2020
Merged

Call pytest using "python -m pytest" #267

merged 2 commits into from
Jan 29, 2020

Conversation

xuhdev
Copy link
Contributor

@xuhdev xuhdev commented Jan 28, 2020

Directly calling "pytest" sometimes breaks tests on "pypy", such as #234, because the actual current code is untested. As explained from pypy website https://docs.pytest.org/en/latest/usage.html:

["python -m pytest"] is almost equivalent to invoking the command line
script pytest [...] directly, except that calling via python will also
add the current directory to sys.path.

Note that, unlike the tests for pypy, the pytest script is not directly invoked in tests for other Python interpreters.

Directly calling "pytest" sometimes breaks tests on "pypy", such as pypa#234, because the actual current code is untested.

As explained from pypy website <https://docs.pytest.org/en/latest/usage.html>:

> ["python -m pytest"] is almost equivalent to invoking the command line
> script pytest [...] directly, except that calling via python will also
> add the current directory to sys.path.

Note that, unlike tests for pypy, the pytest script is not directly invoked in tests for other
Python interpreters.
@pradyunsg pradyunsg merged commit ed9c96c into pypa:master Jan 29, 2020
@xuhdev xuhdev deleted the pytest branch January 29, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants