Does anybody noticed the following strange behaviour for pytest and xdist.
When trying to run the test that is parametrized with some randomly selected values the test are not actualy run. The same test is executed without any problems if xdist is not used.
Following code can be used to reproduce this.
import pytest
import random
PARAMS_NUMBER = 3
PARAMS = []
for i in range(PARAMS_NUMBER):
PARAMS.append(random.randrange(0, 1000))
@pytest.mark.parametrize('rand_par', PARAMS)
def test_random_param(rand_par):
assert 500 > rand_par
Without xdists it works fine.
With xdist no test is executed at all with the following output
============================= test session starts =============================
platform win32 -- Python 2.7.3 -- py-1.4.24 -- pytest-2.6.2
plugins: xdist
gw0 [3] / gw1 [3] / gw2 [3] / gw3 [3]
scheduling tests via LoadScheduling
============================== in 1.93 seconds ===============================
Versions I'm using:
- python 2.7.3
- pytest 2.6.2
- pytest-xdist 1.11
Additional note:
With some older versions (xdist 1.8 and pytest 2.4.X or 2.5.X do not remember exactly) the xdist was stopping on assertion in dsession.py
assert collection == col
Thanks in advance for any help how to solve it or at least workaround it :)