From ee0754bc35628b754da3ca02f7520ef04d59c3e0 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 27 Jul 2018 08:24:34 -0300 Subject: [PATCH] Improve test for Travis fallback --- testing/test_plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/test_plugin.py b/testing/test_plugin.py index 77a6ca4..7a4ac46 100644 --- a/testing/test_plugin.py +++ b/testing/test_plugin.py @@ -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):