Skip to content

Fix testcmdline when it is run with py.test -n0 #5113

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

Merged
merged 2 commits into from
May 26, 2018
Merged

Conversation

msullivan
Copy link
Collaborator

The test runner sets PYTHONPATH when parallelized but not with -n0.
Our subprocess was depending on this to find mypy. We should set up
the state we care about ourselves, so just do that.

The common failure mode here was the tests failing, but I also ran
into a more terrifying mode where it was invoking my installed system
mypy!

This is basically the same fix elazarg proposed in #4127 but that
never went anywhere for unclear reasons.

Fixes #4127.

The test runner sets PYTHONPATH when parallelized but not with -n0.
Our subprocess was depending on this to find mypy. We should set up
the state we care about ourselves, so just do that.

The common failure mode here was the tests failing, but I also ran
into a more terrifying mode where it was invoking my installed system
mypy!

This is basically the same fix elazarg proposed in #4127 but that
never went anywhere for unclear reasons.

Fixes #4127.
@msullivan msullivan requested a review from gvanrossum May 25, 2018 22:53
@msullivan
Copy link
Collaborator Author

...

@gvanrossum gvanrossum merged commit 7eebb8f into master May 26, 2018
@gvanrossum gvanrossum deleted the fix-testcmdline branch May 26, 2018 18:06
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.

Single threaded pytest spuriously fails for testcmdline and testpythoneval
2 participants