Unit test "auto" cpu detection
Use that instead of an acceptance test: on travis it would result in over 16 slaves being spawned, which caused weird crashes on multiprocessing module during teardown Fix #30
This commit is contained in:
@@ -353,17 +353,6 @@ def test_terminate_on_hangingnode(testdir):
|
||||
result.stdout.fnmatch_lines(["*killed*my*", ])
|
||||
|
||||
|
||||
def test_auto_detect_cpus(testdir, monkeypatch):
|
||||
import multiprocessing
|
||||
count = multiprocessing.cpu_count()
|
||||
testdir.makeconftest("""
|
||||
def pytest_configure(config):
|
||||
print("numprocesses: (%s)" % config.getoption("numprocesses"))
|
||||
""")
|
||||
result = testdir.runpytest('-n=auto', '-s')
|
||||
result.stdout.fnmatch_lines(["*numprocesses: (%s)*" % count])
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="works if run outside test suite", run=False)
|
||||
def test_session_hooks(testdir):
|
||||
testdir.makeconftest("""
|
||||
|
||||
Reference in New Issue
Block a user