Comment 0 for bug 666337

Revision history for this message
Martin Packman (gz) wrote :

I get six test failures on Python 2.4 with the tests for AsynchronousDeferredRunTest like this:

======================================================================
FAIL: testtools.tests.test_deferredruntest.TestIntegration.test_runner(AsynchronousDeferredRunTest, Success)
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "C:\bzr\testtools\testtools\runtest.py", line 143, in _run_user
    return fn(*args)
  File "C:\bzr\testtools\testtools\testcase.py", line 539, in _run_test_method
    return self._get_test_method()()
  File "C:\bzr\testtools\testtools\tests\test_deferredruntest.py", line 96, in test_runner
    self.assertEqual(test.calls, self.test_factory.expected_calls)
  File "C:\bzr\testtools\testtools\testcase.py", line 309, in assertEqual
    self.assertThat(observed, matcher)
  File "C:\bzr\testtools\testtools\testcase.py", line 384, in assertThat
    self.fail('Match failed. Matchee: "%s"\nMatcher: %s\nDifference: %s\n'
AssertionError: Match failed. Matchee: "['setUp', 'test', 'tearDown', 'clean-up']"
Matcher: Equals(['setUp', 'test', 'tearDown'])
Difference: ['setUp', 'test', 'tearDown'] != ['setUp', 'test', 'tearDown', 'clean-up']

Basically cleanups aren't being called as AsynchronousDeferredRunTest._run_cleanups uses twisted.internet.defer.inlineCallbacks which needs PEP 342 so is Python 2.5 or later only.

I'm not sure if it's a general problem that the underlying exception is being swallowed, but it's like:

Failure instance: Traceback: exceptions.AttributeError: 'generator' object has no attribute 'send'
C:\Python24\lib\site-packages\twisted\internet\defer.py:186:addCallbacks
C:\Python24\lib\site-packages\twisted\internet\defer.py:328:_runCallbacks
C:\bzr\testtools\testtools\deferredruntest.py:114:clean_up
C:\Python24\lib\site-packages\twisted\internet\defer.py:822:unwindGenerator
--- <exception caught here> ---
C:\Python24\lib\site-packages\twisted\internet\defer.py:737:_inlineCallbacks