Comments (7)
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 loadscope
and 1.21 added loadfile
. Both distributing modes are compatible with pytest-dependency under certain conditions. But these distributing modes are marked experimental in pytest-xdist. I will wait for them to become stable before documenting this option.
from pytest-dependency.
I never used pytest-xdist by now. I need to investigate. Might take some time.
from pytest-dependency.
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.
from pytest-dependency.
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.
from pytest-dependency.
@RKrahl Any workaround for above issue?
from pytest-dependency.
I've tried using --dist=loadfile
but then xdist complains and says:
ERROR: MISSING test execution (tx) nodes: please specify --tx
And with --dist=no
it doesn't work. The dependencies are being skipped.
from pytest-dependency.
@RKrahl Can we perhaps piggyback off of --dist loadgroup
? If we make every connected test belong to their own group, that seems to compatibilize the interaction between the two packages, no?
from pytest-dependency.
Related Issues (20)
- Test suite incompatibility with pytest 6.2 HOT 2
- Tests skipped on linux(3.6.13)(with no test failed) but executing on windows(3.6.10) HOT 3
- Dependency between two tests HOT 1
- session scope not working HOT 1
- Depends on all test methods in class HOT 1
- Conditional dependency on 2 tests HOT 2
- 0.5.1: pytest is failing HOT 4
- Is ordering on fixtures supported?
- only test_b is passed when install pytest-xdist with n>2.
- Not skipping a test when parent test skips or xfails
- The test was skipped,although the dependency test is success. HOT 5
- Dependency call is skipped by executing test with mark HOT 3
- pytest dependency not skipping the dependent tests when failed HOT 3
- when the dependency case use @pytest.mark.parametrize, depened cases was skipped,although the dependency test is success HOT 1
- is @pytest.mark.dependency() can be used for class level? like API test class depends on BVT test class...
- pyproject.toml missing
- Inheriting from test class with dependencies doesn't work correctly HOT 1
- Is pytest-dependency suppose to tell me why a test was skipped? I see nothing in the output explaining why. HOT 1
- Rerunning skipped cases when the parent test fails
- 0.6.0: pep517 based build fails with `Invalid version: 'UNKNOWN'` error message HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-dependency.