2008-08-16 23:26:59 +08:00
|
|
|
|
|
|
|
import py
|
2018-05-23 22:48:46 +08:00
|
|
|
|
|
|
|
failure_demo = py.path.local(__file__).dirpath("failure_demo.py")
|
2018-06-26 21:35:27 +08:00
|
|
|
pytest_plugins = ("pytester",)
|
2018-05-23 22:48:46 +08:00
|
|
|
|
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))
|
2015-04-28 17:54:46 +08:00
|
|
|
result = testdir.runpytest(target, syspathinsert=True)
|
2018-05-23 22:48:46 +08:00
|
|
|
result.stdout.fnmatch_lines(["*42 failed*"])
|
2010-01-18 20:16:58 +08:00
|
|
|
assert result.ret != 0
|