Pytest's testdir fixture may end up creating flaky tests #2751
Comments
Sounds good, thanks @tarcisiofischer! |
tarcisiofischer
pushed a commit
to tarcisiofischer/pytest
that referenced
this issue
Sep 5, 2017
tarcisiofischer
pushed a commit
to tarcisiofischer/pytest
that referenced
this issue
Sep 5, 2017
Resolved by #2752 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While trying to investigate a flaky test on my code, I discovered a problem in the testdir fixture.
I was able to reach the problem while running a test using the testdir fixture too many times and in parallel. The code is something like:
The problem seems to be here (Note that if the for loop ends with never setting the variable, the problem should happen):
https://github.com/pytest-dev/pytest/blob/master/_pytest/pytester.py#L424
My proposal is to change the whole code block with something like
I'll make a PR soon.
The text was updated successfully, but these errors were encountered: