[py-svn] r51562 - in py/branch/event/py/test2: . testing
hpk at codespeak.net
hpk at codespeak.net
Sun Feb 17 18:14:27 CET 2008
Author: hpk
Date: Sun Feb 17 18:14:25 2008
New Revision: 51562
Modified:
py/branch/event/py/test2/executor.py
py/branch/event/py/test2/testing/test_session.py
Log:
fix pdb test, don't automatically raise SystemExit with "--pdb" -
append "-x" if you want this.
Modified: py/branch/event/py/test2/executor.py
==============================================================================
--- py/branch/event/py/test2/executor.py (original)
+++ py/branch/event/py/test2/executor.py Sun Feb 17 18:14:25 2008
@@ -55,9 +55,6 @@
self._fillreport(testrep, excinfo)
if self.config.option.usepdb:
py.__.test2.custompdb.post_mortem(excinfo._excinfo[2])
- # XXX hmm, we probably will not like to continue from that
- # point
- raise SystemExit()
else:
testrep.passed = True
return testrep
Modified: py/branch/event/py/test2/testing/test_session.py
==============================================================================
--- py/branch/event/py/test2/testing/test_session.py (original)
+++ py/branch/event/py/test2/testing/test_session.py Sun Feb 17 18:14:25 2008
@@ -211,7 +211,7 @@
def test_pdb_run(self):
tfile = suptest.makeuniquepyfile("""
- def test_1():
+ def test_usepdb():
assert 0
""")
l = []
@@ -219,17 +219,16 @@
l.append(args)
py.magic.patch(py.__.test2.custompdb, 'post_mortem', mypdb)
try:
- sorter = suptest.initsorter_from_cmdline([tfile, '--pdb'])
- py.test.raises(SystemExit, sorter.session.main)
- passed, skipped, failed = sorter.countoutcomes()
- assert passed == skipped == 0
- assert len(l) == 1
- # XXX assert failed == 1
- py.test.skip("XXX streamline event generation with --pdb")
- # XXX add some more checks?
+ sorter = suptest.events_from_cmdline([tfile, '--pdb'])
finally:
py.magic.revert(py.__.test2.custompdb, 'post_mortem')
+ rep = sorter.getreport("test_usepdb")
+ assert rep.failed
+ assert len(l) == 1
+ tb = py.code.Traceback(l[0][0])
+ assert tb[-1].name == "test_usepdb"
+
def test_basic_testitem_events(self):
tfile = suptest.makeuniquepyfile("""
def test_one():
More information about the pytest-commit
mailing list