Return values from tests are ignored
Bug #906251 reported by
Gavin Panella
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
We've had a situation in Launchpad where tests return Deferred objects, but the test runner didn't care and we had not set run_tests_with to AsynchronousDef
Tests do not normally return anything, so it may be useful if testtools could warn about tests that do return something other than None, to draw attention to mistakes of this kind.
To post a comment you must log in.
I'm not 100% sure that this would be a desirable feature for core testtools.
However, if you're interested in doing this for Launchpad, you could do this override in your base TestCase:
def _run_test_ method( self, result): test_method( )()
self.assertIs( None, ret)
ret = self._get_
return ret
The API isn't public, so it's liable to change without concern for backwards compatibility. However, it would do the job.
This is also the first actual use case I've seen for bug 584824.