2008-08-16 23:26:59 +08:00
|
|
|
|
|
|
|
import py
|
2010-01-17 17:54:36 +08:00
|
|
|
failure_demo = py.path.local(__file__).dirpath('failure_demo.py')
|
2010-11-21 04:35:55 +08:00
|
|
|
pytest_plugins = 'pytester',
|
2008-09-02 20:24:15 +08:00
|
|
|
|
2010-07-27 03:15:15 +08:00
|
|
|
def test_failure_demo_fails_properly(testdir):
|
2010-01-18 20:16:58 +08:00
|
|
|
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([
|
2014-08-24 01:01:26 +08:00
|
|
|
"*42 failed*"
|
2010-01-18 20:16:58 +08:00
|
|
|
])
|
|
|
|
assert result.ret != 0
|