Merge lp:~mordred/testtools/add-file-to-upcall-errors into lp:testtools

Proposed by Monty Taylor
Status: Needs review
Proposed branch: lp:~mordred/testtools/add-file-to-upcall-errors
Merge into: lp:testtools
Diff against target: 29 lines (+4/-2)
1 file modified
testtools/testcase.py (+4/-2)
To merge this branch: bzr merge lp:~mordred/testtools/add-file-to-upcall-errors
Reviewer Review Type Date Requested Status
testing-cabal Pending
Review via email: mp+147048@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

Thanks for the patch! Good idea.

I'll merge it into our new trunk, which you can find at <https://github.com/testing-cabal/testtools>.

Unmerged revisions

315. By Monty Taylor

Report filenames in upcall errors.

Match other errors, which report filenames due to having exceptions
associated with them. Since these errors don't stem from exceptions,
it's harder to directly follow where the problem came from.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'testtools/testcase.py'
2--- testtools/testcase.py 2013-01-18 11:24:57 +0000
3+++ testtools/testcase.py 2013-02-07 09:31:21 +0000
4@@ -531,10 +531,11 @@
5 ret = self.setUp()
6 if not self.__setup_called:
7 raise ValueError(
8+ "In File: %s\n"
9 "TestCase.setUp was not called. Have you upcalled all the "
10 "way up the hierarchy from your setUp? e.g. Call "
11 "super(%s, self).setUp() from your setUp()."
12- % self.__class__.__name__)
13+ % (self.__class__.__file__, self.__class__.__name__))
14 return ret
15
16 def _run_teardown(self, result):
17@@ -547,10 +548,11 @@
18 ret = self.tearDown()
19 if not self.__teardown_called:
20 raise ValueError(
21+ "In File: %s\n"
22 "TestCase.tearDown was not called. Have you upcalled all the "
23 "way up the hierarchy from your tearDown? e.g. Call "
24 "super(%s, self).tearDown() from your tearDown()."
25- % self.__class__.__name__)
26+ % (self.__class__.__file__, self.__class__.__name__))
27 return ret
28
29 def _get_test_method(self):

Subscribers

People subscribed via source and target branches

to all changes: