@defer.inlineCallbacks incompatible with Python 2.4

Bug #666337 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Critical
Jonathan Lange

Bug Description

I get eight 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

Martin Packman (gz)
description: updated
Jonathan Lange (jml)
Changed in testtools:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Jonathan Lange (jml)
milestone: none → next
Changed in testtools:
importance: High → Critical
Changed in testtools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.