Merged pull request #18

This commit is contained in:
Floris Bruynooghe
2015-08-04 23:30:50 +01:00
2 changed files with 29 additions and 0 deletions

View File

@@ -1,10 +1,14 @@
1.13.dev1 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 - 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 number of times pytest-xdist can restart slaves due to crashes. Thanks to
Anatoly Bubenkov for the report and Bruno Oliveira for the PR. Anatoly Bubenkov for the report and Bruno Oliveira for the PR.
- release as wheel - release as wheel
- "-n" option now can be set to "auto" for automatic detection of number - "-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. of cpus in the host system. Thanks Suloev Dmitry for the PR.

View File

@@ -410,6 +410,31 @@ def test_session_hooks(testdir):
assert testdir.tmpdir.join("slave").check() assert testdir.tmpdir.join("slave").check()
assert testdir.tmpdir.join("master").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): def test_funcarg_teardown_failure(testdir):
p = testdir.makepyfile(""" p = testdir.makepyfile("""
def pytest_funcarg__myarg(request): def pytest_funcarg__myarg(request):