Merge lp:~jelmer/brz/selftest-traceback into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/selftest-traceback
Merge into: lp:brz
Diff against target: 34 lines (+4/-2)
2 files modified
breezy/tests/__init__.py (+2/-2)
python3.passing (+2/-0)
To merge this branch: bzr merge lp:~jelmer/brz/selftest-traceback
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+353737@code.launchpad.net

Commit message

Don't rely on self._traceback_from_test as it gets set too late on Python 3 unittest.TestCase.

Description of the change

Don't rely on self._traceback_from_test as it gets set too late on Python 3 unittest.TestCase.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Okay, I guess I can live with this, though it's a hack that we could do with getting rid of rather than making conditional if possible.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/__init__.py'
2--- breezy/tests/__init__.py 2018-08-13 01:38:21 +0000
3+++ breezy/tests/__init__.py 2018-08-24 20:18:15 +0000
4@@ -458,7 +458,7 @@
5 Called from the TestCase run() method when the test
6 fails with an unexpected error.
7 """
8- self._post_mortem(self._traceback_from_test)
9+ self._post_mortem(self._traceback_from_test or err[2])
10 super(ExtendedTestResult, self).addError(test, err)
11 self.error_count += 1
12 self.report_error(test, err)
13@@ -471,7 +471,7 @@
14 Called from the TestCase run() method when the test
15 fails because e.g. an assert() method failed.
16 """
17- self._post_mortem(self._traceback_from_test)
18+ self._post_mortem(self._traceback_from_test or err[2])
19 super(ExtendedTestResult, self).addFailure(test, err)
20 self.failure_count += 1
21 self.report_failure(test, err)
22
23=== modified file 'python3.passing'
24--- python3.passing 2018-08-23 10:19:35 +0000
25+++ python3.passing 2018-08-24 20:18:15 +0000
26@@ -28746,6 +28746,8 @@
27 breezy.tests.test_selftest.TestPostMortemDebugging.test_env_var_triggers_post_mortem
28 breezy.tests.test_selftest.TestPostMortemDebugging.test_location_bt_error
29 breezy.tests.test_selftest.TestPostMortemDebugging.test_location_bt_failure
30+breezy.tests.test_selftest.TestPostMortemDebugging.test_location_unittest_error
31+breezy.tests.test_selftest.TestPostMortemDebugging.test_location_unittest_failure
32 breezy.tests.test_selftest.TestProfileResult.test_profiles_tests
33 breezy.tests.test_selftest.TestRepositoryScenarios.test_formats_to_scenarios
34 breezy.tests.test_selftest.TestRunBzrCaptured.test_stdin

Subscribers

People subscribed via source and target branches