parent
55fcc5a219
commit
1e76202b65
|
@ -5,10 +5,11 @@ failure_demo = py.path.local(__file__).dirpath('failure_demo.py')
|
||||||
pytest_plugins = "pytest_pytester"
|
pytest_plugins = "pytest_pytester"
|
||||||
|
|
||||||
def test_failure_demo_fails_properly(testdir):
|
def test_failure_demo_fails_properly(testdir):
|
||||||
reprec = testdir.inline_run(failure_demo)
|
target = testdir.tmpdir.join(failure_demo.basename)
|
||||||
passed, skipped, failed = reprec.countoutcomes()
|
failure_demo.copy(target)
|
||||||
assert passed == 0
|
failure_demo.copy(testdir.tmpdir.join(failure_demo.basename))
|
||||||
assert failed == 20, failed
|
result = testdir.runpytest(target)
|
||||||
colreports = reprec.getreports("pytest_collectreport")
|
result.stdout.fnmatch_lines([
|
||||||
failed = len([x.failed for x in colreports])
|
"*20 failed*"
|
||||||
assert failed == 3
|
])
|
||||||
|
assert result.ret != 0
|
||||||
|
|
Loading…
Reference in New Issue