turn this into a black-box test

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-01-18 13:16:58 +01:00
parent 55fcc5a219
commit 1e76202b65
1 changed files with 8 additions and 7 deletions

View File

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