[py-svn] r50986 - py/branch/reporter-merge/py/doc/example/pytest

hpk at codespeak.net hpk at codespeak.net
Thu Jan 24 18:53:50 CET 2008


Author: hpk
Date: Thu Jan 24 18:53:50 2008
New Revision: 50986

Modified:
   py/branch/reporter-merge/py/doc/example/pytest/test_failures.py
Log:
refactoring test to use countoutcomes helper - it fails though: 
failure demo yield 21 failures not only 20 (compare it to
running "py.test failure_demo.py" which does report 21 failures) 



Modified: py/branch/reporter-merge/py/doc/example/pytest/test_failures.py
==============================================================================
--- py/branch/reporter-merge/py/doc/example/pytest/test_failures.py	(original)
+++ py/branch/reporter-merge/py/doc/example/pytest/test_failures.py	Thu Jan 24 18:53:50 2008
@@ -1,13 +1,11 @@
 
 import py
 failure_demo = py.magic.autopath().dirpath('failure_demo.py')
-from py.__.test.outcome import Failed, Passed
+from py.__.doc.test_conftest import countoutcomes 
 
 def test_failure_demo_fails_properly(): 
     config = py.test.config._reparse([failure_demo]) 
     session = config.initsession()
-    session.main()
-    l = session.getitemoutcomepairs(Failed)
-    assert len(l) == 21 
-    l = session.getitemoutcomepairs(Passed)
-    assert not l 
+    failed, passed, skipped = countoutcomes(session) 
+    assert failed == 21 
+    assert passed == 0 



More information about the pytest-commit mailing list