diff --git a/changelog/316.bugfix b/changelog/316.bugfix new file mode 100644 index 0000000..4685b5a --- /dev/null +++ b/changelog/316.bugfix @@ -0,0 +1 @@ +Workaround cpu detection on Travis CI diff --git a/xdist/plugin.py b/xdist/plugin.py index 278b65d..881be4a 100644 --- a/xdist/plugin.py +++ b/xdist/plugin.py @@ -1,3 +1,5 @@ +import os + import py import pytest @@ -7,6 +9,9 @@ def parse_numprocesses(s): try: from os import sched_getaffinity except ImportError: + if os.environ.get('TRAVIS') == 'true': + # workaround https://bitbucket.org/pypy/pypy/issues/2375 + return 2 try: from os import cpu_count except ImportError: