-
Notifications
You must be signed in to change notification settings - Fork 35
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
Tests are skipped with pytest-xdist #8
Comments
I never used pytest-xdist by now. I need to investigate. Might take some time. |
I still didn't got a round to investigate this in detail. But after having a short glance on the pytest-xdist documentation, I assume the problem is the following: pytest-xdist features to run the tests in parallel. It seem to do this in parallel processes, each running its own pytest instance. As a result, the dependent test is skipped because its dependency has not been run (in the same parallel instance of pytest). I'm afraid, this is fundamentally incompatible with pytest-dependency, because such a parallelization can only work if the tests are independent from each other. But the very purpose of pytest-dependency is to handle the case that they are not. If this assumption turn out to be true, the only thing pytest-dependency can do about this problem, is to disable the parallelization in pytest-xdist. I would still need to figure out how to do this. |
I finally got around to take a closer look. My first assumption from the last comment turns out to be right, the problem is the parallelization in pytest-xdist. This can only work if the test are independent from each other. There is not much that pytest-dependency can do about this. I will refrain from trying to disable the parallelization in pytest-xdist, as I think plugins should not interfere with each other. The only thing I can do is to document this incompatibility. |
I documented the incompatibility with the parallelization in pytest-xdist and closed this issue. However, this is not the full story: pytest-xdist 1.19 added distributing mode |
@RKrahl Any workaround for above issue? |
I've tried using
And with |
@RKrahl Can we perhaps piggyback off of |
pytest-dependency does not seem to behave well when using pytest-xdist. Some tests are skipped when they should not be. Let's see how to quickly reproduce the bug:
test_foobar.py
console
output
The text was updated successfully, but these errors were encountered: