TestUtil.visitTests() fails for trial TestCase instances

Bug #264575 reported by James Henstridge
2
Affects Status Importance Assigned to Milestone
testresources
Fix Released
Undecided
Jonathan Lange

Bug Description

Twisted's Trial TestCase class implements a visit() method that calls its argument. This calling convention differs to what TestUtil.visitTests() expects, leading to failures in methods like OptimisingTestSuite.adsorbSuite():
    Traceback (most recent call last):
      File "./test", line 149, in <module>
        test_with_trial()
      File "./test", line 139, in test_with_trial
        suite.adsorbSuite(collect_tests(parse_sys_argv()))
      File "/var/lib/python-support/python2.5/testresources/__init__.py", line 50, in adsorbSuite
        TestUtil.visitTests(suite, testAdder)
      File "/var/lib/python-support/python2.5/testresources/tests/TestUtil.py", line 57, in visitTests
        visitTests(test, visitor)
      File "/var/lib/python-support/python2.5/testresources/tests/TestUtil.py", line 57, in visitTests
        visitTests(test, visitor)
      File "/var/lib/python-support/python2.5/testresources/tests/TestUtil.py", line 57, in visitTests
        visitTests(test, visitor)
      File "/var/lib/python-support/python2.5/testresources/tests/TestUtil.py", line 51, in visitTests
        test.visit(visitor)
      File "/usr/lib/python2.5/site-packages/twisted/trial/unittest.py", line 849, in visit
        visitor(self)
    TypeError: 'TestAdder' object is not callable

Revision history for this message
James Henstridge (jamesh) wrote :

The pyunit3k iterate_tests() method doesn't have this problem, so the bug should be fixed with r18.

Changed in testresources:
status: New → Fix Committed
Revision history for this message
Jonathan Lange (jml) wrote :

It's on trunk, so marking as Fix Released.

Changed in testresources:
assignee: nobody → jml
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.