2008-08-16 23:26:59 +08:00
|
|
|
|
|
|
|
import py
|
|
|
|
failure_demo = py.magic.autopath().dirpath('failure_demo.py')
|
2008-09-02 20:24:15 +08:00
|
|
|
|
|
|
|
from py.__.test.testing import suptest
|
|
|
|
from py.__.test import event
|
2008-08-16 23:26:59 +08:00
|
|
|
|
|
|
|
def test_failure_demo_fails_properly():
|
2008-09-02 20:24:15 +08:00
|
|
|
sorter = suptest.events_from_cmdline([failure_demo])
|
|
|
|
passed, skipped, failed = sorter.countoutcomes()
|
2008-08-16 23:26:59 +08:00
|
|
|
assert passed == 0
|
2008-09-02 20:24:15 +08:00
|
|
|
assert failed == 20, failed
|
|
|
|
colreports = sorter.get(event.CollectionReport)
|
|
|
|
failed = len([x.failed for x in colreports])
|
|
|
|
assert failed == 5
|