testtools breaks if a string exception is raised
Bug #592262 reported by
Martin Packman
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Fix Released
|
Wishlist
|
Martin Packman |
Bug Description
Testtools deliberately lets string exceptions from test cases propagate, rather than cause failures:
except Exception:
# Note that bare exceptions are not caught, so raised strings will
# escape: but they are deprecated anyway.
Given that, though deprecated, such things are not completely unheard of, see <lp:~jelmer/bzr/no-string-exc> for instance, it might be worth rethinking this. Bazaar at least has various bits of core infrastruture that prefer the test suite not to randomly fall over when it has issues.
Related branches
lp:~gz/testtools/catch_string_exceptions_592262
- testtools developers: Pending requested
-
Diff: 53 lines (+5/-5)4 files modifiedtesttools/compat.py (+1/-1)
testtools/runtest.py (+1/-3)
testtools/testcase.py (+3/-0)
testtools/tests/test_testresult.py (+0/-1)
Changed in testtools: | |
status: | In Progress → Fix Committed |
milestone: | none → 0.9.5 |
Changed in testtools: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
E ======= ======= ======= ======= ======= ======= ======= ======= ======= exception (__main__.Test) ------- ------- ------- ------- ------- ------- ------- ------- ------- testtools_ string_ exception. py", line 5, in test_string_ exception
=======
ERROR: test_string_
-------
Traceback (most recent call last):
File "C:\Python24\
raise "string exception"
string exception
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 1 test in 0.000s
FAILED (errors=1)