Closed
Description
Steps to reproduce the problem:
-
Create some test cases that look as follows:
def _test(a): def t(self): assert a == a return t class TestFoo(object): test_x = _test("a") test_y = _test("b")
-
Run
py.test -n 4
What is the expected behavior?
The tests should pass.
What went wrong?
λ py.test test_foo.py -n 4
============================= test session starts =============================
platform win32 -- Python 3.5.0, pytest-2.8.0, py-1.4.30, pluggy-0.3.1
rootdir: C:\Users\user\git\netlib, inifile:
plugins: cov-2.1.0, xdist-1.13.1
gw0 [2] / gw1 [2] / gw2 [2] / gw3 [2]
scheduling tests via LoadScheduling
collecting 0 items / 3 errors
=================================== ERRORS ====================================
____________________________ ERROR collecting gw0 _____________________________
Different tests were collected between gw2 and gw0. The difference is:
--- gw2
+++ gw0
@@ -1,2 +1,2 @@
+test_foo.py::TestFoo::()::test_y
test_foo.py::TestFoo::()::test_x
-test_foo.py::TestFoo::()::test_y
=========================== 3 error in 1.17 seconds ===========================
This is the minimal test case I could break it down to. Looks like there's an issue if we're not def
ing functions. Any help would be appreciated! 😃