2007-01-24 22:24:01 +08:00
|
|
|
|
|
|
|
import py
|
|
|
|
failure_demo = py.magic.autopath().dirpath('failure_demo.py')
|
2007-02-03 20:14:46 +08:00
|
|
|
from py.__.test.outcome import Failed, Passed
|
2007-01-24 22:24:01 +08:00
|
|
|
|
|
|
|
def test_failure_demo_fails_properly():
|
|
|
|
config = py.test.config._reparse([failure_demo])
|
2007-01-25 00:46:46 +08:00
|
|
|
session = config.initsession()
|
2007-01-24 22:24:01 +08:00
|
|
|
session.main()
|
2007-02-03 20:14:46 +08:00
|
|
|
l = session.getitemoutcomepairs(Failed)
|
2007-01-24 22:24:01 +08:00
|
|
|
assert len(l) == 21
|
2007-02-03 20:14:46 +08:00
|
|
|
l = session.getitemoutcomepairs(Passed)
|
2007-01-24 22:24:01 +08:00
|
|
|
assert not l
|