Improve test for Travis fallback

This commit is contained in:
Bruno Oliveira
2018-07-27 08:24:34 -03:00
parent 5c59a30277
commit ee0754bc35

View File

@@ -45,10 +45,10 @@ def test_auto_detect_cpus(testdir, monkeypatch):
config = testdir.parseconfigure("-nauto")
assert config.getoption('numprocesses') == 99
if not hasattr(os, 'sched_getaffinity'):
monkeypatch.setenv('TRAVIS', 'true')
config = testdir.parseconfigure("-nauto")
assert config.getoption('numprocesses') == 2
monkeypatch.delattr(os, 'sched_getaffinity', raising=False)
monkeypatch.setenv('TRAVIS', 'true')
config = testdir.parseconfigure("-nauto")
assert config.getoption('numprocesses') == 2
def test_boxed_with_collect_only(testdir):