Skip to content

Commit

Permalink
Skip multiprocessing using tests when run from py.test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Jun 28, 2015
1 parent b685890 commit 943fffa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
import multiprocessing
import subprocess
import traceback
import pytest

from asv import util


WIN = (os.name == 'nt')


def _multiprocessing_raise_processerror(arg):
try:
raise util.ProcessError(["a"], 1, "aa", "bb")
Expand All @@ -34,6 +38,11 @@ def _multiprocessing_raise_usererror(arg):
def test_parallelfailure():
# Check the workaround for https://bugs.python.org/issue9400 works

if WIN and os.path.basename(sys.argv[0]).lower().startswith('py.test'):
# Multiprocessing in spawn mode can result to problems with py.test
pytest.skip("Multiprocessing spawn mode on Windows not safe to run "
"from py.test runner.")

# The exception class must be pickleable
exc = util.ParallelFailure("test", Exception, "something")
exc2 = pickle.loads(pickle.dumps(exc))
Expand Down

0 comments on commit 943fffa

Please sign in to comment.