1
diff -Nur -x '*.orig' -x '*~' testresources-0.2/lib/testresources/__init__.py testresources-0.2.new/lib/testresources/__init__.py
2
--- testresources-0.2/lib/testresources/__init__.py 2009-07-17 13:20:26.000000000 +0100
3
+++ testresources-0.2.new/lib/testresources/__init__.py 2009-08-05 23:38:21.000000000 +0100
5
stack = inspect.stack()
6
for frame in stack[3:]:
7
if frame[3] in ('run', '__call__'):
8
- return frame[0].f_locals['result']
9
+ # Not all frames called 'run' will be unittest. It could be a
10
+ # reactor in trial, for instance.
11
+ result = frame[0].f_locals.get('result')
12
+ if (result is not None and
13
+ getattr(result, 'startTest', None) is not None):
17
unittest.TestCase.setUp(self)