An unexpectedSuccess is like a failure not a success
Bug #654474 reported by
Martin Packman
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Packman | ||
subunit |
Fix Released
|
Wishlist
|
Robert Collins | ||
testtools |
Fix Released
|
Wishlist
|
Jonathan Lange |
Bug Description
When the function passed to expectedFailure did not raise an assertion, bzr used to do:
self.
With testtools, bazaar now treats that as a success, as jam noted in February:
<https:/
And in September he pointed out the same thing, but with subunit:
<https:/
Subunit needs to roundtrip unexpected successes now that the standard library and testtools support them.
Related branches
lp:~jml/testtools/unexpected-success
- testtools developers: Pending requested
-
Diff: 90 lines (+39/-3)3 files modifiedNEWS (+3/-0)
testtools/testresult/real.py (+5/-1)
testtools/tests/test_testresult.py (+31/-2)
lp:~jml/testtools/unexpected-success-2
- Martin Packman: Needs Fixing
- Robert Collins: Approve
-
Diff: 570 lines (+233/-38)5 files modifiedNEWS (+6/-1)
testtools/testresult/doubles.py (+17/-1)
testtools/testresult/real.py (+38/-3)
testtools/tests/test_compat.py (+8/-7)
testtools/tests/test_testresult.py (+164/-26)
lp:~gz/bzr/unexpected_successes_are_bad_654474
- Andrew Bennetts: Approve
-
Diff: 146 lines (+67/-12)4 files modifiedbzrlib/tests/__init__.py (+26/-0)
bzrlib/tests/per_workingtree/test_smart_add.py (+20/-12)
bzrlib/tests/test_selftest.py (+18/-0)
doc/en/release-notes/bzr-2.4.txt (+3/-0)
Changed in testtools: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in testtools: | |
status: | Triaged → In Progress |
assignee: | nobody → Jonathan Lange (jml) |
Changed in testtools: | |
status: | In Progress → Fix Committed |
milestone: | none → next |
Changed in testtools: | |
status: | In Progress → Fix Committed |
Changed in testtools: | |
status: | Fix Committed → Fix Released |
Changed in subunit: | |
status: | New → Incomplete |
description: | updated |
Changed in subunit: | |
assignee: | nobody → Robert Collins (lifeless) |
importance: | Undecided → Wishlist |
Changed in subunit: | |
status: | Confirmed → Fix Committed |
milestone: | none → next |
Changed in bzr: | |
assignee: | nobody → Martin [gz] (gz) |
status: | Confirmed → In Progress |
Changed in bzr: | |
milestone: | none → 2.4b3 |
status: | In Progress → Fix Released |
Changed in subunit: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
What unittest does in Python 2.7:
except _UnexpectedSuccess:
addUnexpectedS uccess = getattr(result, 'addUnexpectedS uccess' , None) ccess is not None:
addUnexpec tedSuccess( self)
warnings. warn("TestResul t has no addUnexpectedSu ccess method, reporting as failures",
RuntimeWar ning)
result. addFailure( self, sys.exc_info())
if addUnexpectedSu
else: