← Back to team overview

testtools-dev team mailing list archive

[Bug 666337] [NEW] @defer.inlineCallbacks incompatible with Python 2.4

 

Public bug reported:

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

** Affects: testtools
     Importance: Undecided
         Status: New

** Description changed:

- I get six test failures on Python 2.4 with the tests for
+ 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

-- 
@defer.inlineCallbacks incompatible with Python 2.4
https://bugs.launchpad.net/bugs/666337
You received this bug notification because you are a member of testtools
developers, which is subscribed to testtools.

Status in testtools: New

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





Follow ups

References