From 5c59a302775b1ae40afc6510fb30e72b95eb8092 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 26 Jul 2018 12:56:10 +0300 Subject: [PATCH] Add coverage test for Travis CI workaround --- testing/test_plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/test_plugin.py b/testing/test_plugin.py index d5c32ba..77a6ca4 100644 --- a/testing/test_plugin.py +++ b/testing/test_plugin.py @@ -45,6 +45,11 @@ 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 + def test_boxed_with_collect_only(testdir): from xdist.plugin import pytest_cmdline_main as check_options