You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
py.test not running any tests when using -n (xdist) #669
Managed to pin the problem on a specific use case: it happens when parameters are different between workers in pytest.mark.parametrize. For instance, the following simple test will reproduce it:
Original comment byFloris Bruynooghe (BitBucket: flub, GitHub: flub):
AFAIK when using xdist the tests collected on all hosts must have exactly the same test IDs. This means you can not have different parameters depending on the host.
You might be able to work around this in the above example by explicitly giving parameter IDs (which are used to create the test IDs): @pytest.mark.parametrize('param', params=[time.time(), 1, 2, 3], ids=['time', '1', '2', '3']).
When I run this with an up-to-date pytest and pytest-xdist, I get an error message instead:
================================== ERRORS ===================================
___________________________ ERROR collecting gw0 ____________________________
Different tests were collected between gw2 and gw0. The difference is:
--- gw2
+++ gw0
@@ -1,4 +1,4 @@
-foo.py::test_something[1436343943.2776034]
+foo.py::test_something[1436343943.234645]
foo.py::test_something[1]
foo.py::test_something[2]
foo.py::test_something[3]
___________________________ ERROR collecting gw1 ____________________________
Different tests were collected between gw2 and gw1. The difference is:
--- gw2
+++ gw1
@@ -1,4 +1,4 @@
-foo.py::test_something[1436343943.2776034]
+foo.py::test_something[1436343943.2553692]
foo.py::test_something[1]
foo.py::test_something[2]
foo.py::test_something[3]
___________________________ ERROR collecting gw3 ____________________________
Different tests were collected between gw2 and gw3. The difference is:
--- gw2
+++ gw3
@@ -1,4 +1,4 @@
-foo.py::test_something[1436343943.2776034]
+foo.py::test_something[1436343943.3050516]
foo.py::test_something[1]
foo.py::test_something[2]
foo.py::test_something[3]
Activity
pytestbot commentedon Feb 17, 2015
Original comment by BitBucket: vmalloc, GitHub: vmalloc:
Managed to pin the problem on a specific use case: it happens when parameters are different between workers in pytest.mark.parametrize. For instance, the following simple test will reproduce it:
It would be helpful to at least get a clear error message explaining why things aren't running...
pytestbot commentedon Apr 30, 2015
Original comment by Rok Garbas (BitBucket: garbas, GitHub: garbas):
i also stumble upon this problem. (pytest-2.6.2, pytest-xdist-1.11)
somebody has any idea how to go about solving this? any pointers would be welcome.
pytestbot commentedon Apr 30, 2015
Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):
AFAIK when using xdist the tests collected on all hosts must have exactly the same test IDs. This means you can not have different parameters depending on the host.
You might be able to work around this in the above example by explicitly giving parameter IDs (which are used to create the test IDs):
@pytest.mark.parametrize('param', params=[time.time(), 1, 2, 3], ids=['time', '1', '2', '3']).pytestbot commentedon Apr 30, 2015
Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):
Actually, I believe this is a duplicate of issue #594.
pytestbot commentedon Apr 30, 2015
Original comment by Rok Garbas (BitBucket: garbas, GitHub: garbas):
same error is also present in pytest-2.7.0
The-Compiler commentedon Jul 8, 2015
When I run this with an up-to-date pytest and pytest-xdist, I get an error message instead:
So can this be closed, @garbas?
RonnyPfannschmidt commentedon Jan 1, 2016
Closing as duplicate of #920