diff --git a/CHANGELOG b/CHANGELOG index 76e4775..874adb1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,14 @@ 1.13.dev1 ------------------------- +- conforming with new pytest-2.8 behavior of returning non-zero when all + tests were skipped or deselected. + - new "--max-slave-restart" option that can be used to control maximum number of times pytest-xdist can restart slaves due to crashes. Thanks to Anatoly Bubenkov for the report and Bruno Oliveira for the PR. - release as wheel + - "-n" option now can be set to "auto" for automatic detection of number of cpus in the host system. Thanks Suloev Dmitry for the PR. diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index c357641..ec53c67 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -410,6 +410,31 @@ def test_session_hooks(testdir): assert testdir.tmpdir.join("slave").check() assert testdir.tmpdir.join("master").check() + +def test_session_testscollected(testdir): + """ + Make sure master node is updating the session object with the number + of tests collected from the slaves. + """ + testdir.makepyfile(test_foo=""" + import pytest + @pytest.mark.parametrize('i', range(3)) + def test_ok(i): + pass + """) + testdir.makeconftest(""" + def pytest_sessionfinish(session): + collected = getattr(session, 'testscollected', None) + with open('testscollected', 'w') as f: + f.write('collected = %s' % collected) + """) + result = testdir.inline_run("-n1") + result.assertoutcome(passed=3) + collected_file = testdir.tmpdir.join('testscollected') + assert collected_file.isfile() + assert collected_file.read() == 'collected = 3' + + def test_funcarg_teardown_failure(testdir): p = testdir.makepyfile(""" def pytest_funcarg__myarg(request):