Merge lp:~gz/testtools/avoid_exc_info_cycles into lp:~testtools-committers/testtools/trunk
Status: | Merged |
---|---|
Merged at revision: | 103 |
Proposed branch: | lp:~gz/testtools/avoid_exc_info_cycles |
Merge into: | lp:~testtools-committers/testtools/trunk |
Diff against target: |
79 lines (+19/-9) 4 files modified
testtools/run.py (+1/-3) testtools/runtest.py (+5/-2) testtools/testcase.py (+12/-4) testtools/tests/helpers.py (+1/-0) |
To merge this branch: | bzr merge lp:~gz/testtools/avoid_exc_info_cycles |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins | Approve | ||
Review via email: mp+32726@code.launchpad.net |
Description of the change
Adds try/finally/del in a few places that assigned result of sys.exc_info call to a local variable. This creates a reference cycle, which while mostly harmless as will be dealt with by gc, can be annoying when trying to write deterministic code.
There are a couple I've not resolved. The one in testtools.
See <lp:~gz/bzr/cleanup_testcases_by_collection_613247> for branch to bzr that prompted this change.
I've also tweaked this one - you had no test coverage (your change only checked the error path), and I've made the no-reason fallback supply the whole details dict (because something has obviously gone wrong).