Files
pytest-xdist/testing/test_boxed.py
holger krekel 2efb059d75 adapt to new refactored py baseline.
remove pickling in distributed testing
refactor internal mechanism enough to work for -n1
* * *
fix handling of crashing items and slave down events
2010-09-27 16:13:54 +02:00

29 lines
846 B
Python

import py
@py.test.mark.skipif("not hasattr(os, 'fork')")
def test_functional_boxed(testdir):
p1 = testdir.makepyfile("""
import os
def test_function():
os.kill(os.getpid(), 15)
""")
result = testdir.runpytest(p1, "--boxed")
result.stdout.fnmatch_lines([
"*CRASHED*",
"*1 failed*"
])
class TestOptionEffects:
def test_boxed_option_default(self, testdir):
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
config = testdir.reparseconfig()
assert not config.option.boxed
py.test.importorskip("execnet")
config = testdir.reparseconfig(['-d', tmpdir])
assert not config.option.boxed
def test_is_not_boxed_by_default(self, testdir):
config = testdir.reparseconfig([testdir.tmpdir])
assert not config.option.boxed