Files
pytest2/py/doc/example/pytest/test_failures.py
hpk c17a09adaf [svn r62211] merge 60797:HEAD of pytestplugin branch:
this merge contains:

* a new plugin architecture
* a pluginized pytest core
* many pytest related refactorings
* refactorings/streamlining of pytest's own tests

--HG--
branch : trunk
2009-02-27 11:18:27 +01:00

15 lines
439 B
Python

import py
failure_demo = py.magic.autopath().dirpath('failure_demo.py')
pytest_plugins = "pytest_pytester"
def test_failure_demo_fails_properly(testdir):
sorter = testdir.inline_run(failure_demo)
passed, skipped, failed = sorter.countoutcomes()
assert passed == 0
assert failed == 20, failed
colreports = sorter.getnamed("collectionreport")
failed = len([x.failed for x in colreports])
assert failed == 5