StartUpFailure.shortDescription() fails with AttributeError

Bug #221151 reported by Marius Gedminas
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zope.testing
Fix Released
Medium
Roman Joost
zope.testrunner
Fix Released
Medium
Tres Seaver

Bug Description

StartUpFailure subclasses unittest.TestCase, but doesn't call its __init__, which eventually results in
this error when a test suite containing a StartUpFailure object gets passed to the real unittest.TextTestRunner

> Traceback (most recent call last):
> File "setup.py", line 47, in <module>
> 'zope.testing',
> File "/usr/lib64/python2.5/distutils/core.py", line 151, in setup
> dist.run_commands()
> File "/usr/lib64/python2.5/distutils/dist.py", line 974, in run_commands
> self.run_command(cmd)
> File "/usr/lib64/python2.5/distutils/dist.py", line 994, in run_command
> cmd_obj.run()
> File "/usr/lib/python2.5/site-packages/setuptools/command/test.py", line 119, in run
> self.with_project_on_sys_path(self.run_tests)
> File "/usr/lib/python2.5/site-packages/setuptools/command/test.py", line 101, in with_project_on_sys_path
> func()
> File "/usr/lib/python2.5/site-packages/setuptools/command/test.py", line 130, in run_tests
> testLoader = loader_class()
> File "/usr/lib64/python2.5/unittest.py", line 768, in __init__
> self.runTests()
> File "/usr/lib64/python2.5/unittest.py", line 805, in runTests
> result = self.testRunner.run(self.test)
> File "/usr/lib64/python2.5/unittest.py", line 705, in run
> test(result)
> File "/usr/lib64/python2.5/unittest.py", line 437, in __call__
> return self.run(*args, **kwds)
> File "/usr/lib64/python2.5/unittest.py", line 433, in run
> test(result)
> File "/usr/lib64/python2.5/unittest.py", line 437, in __call__
> return self.run(*args, **kwds)
> File "/usr/lib64/python2.5/unittest.py", line 433, in run
> test(result)
> File "/usr/lib64/python2.5/unittest.py", line 281, in __call__
> return self.run(*args, **kwds)
> File "/usr/lib64/python2.5/unittest.py", line 247, in run
> result.startTest(self)
> File "/usr/lib64/python2.5/unittest.py", line 649, in startTest
> self.stream.write(self.getDescription(test))
> File "/usr/lib64/python2.5/unittest.py", line 642, in getDescription
> return test.shortDescription() or str(test)
> File "/usr/lib64/python2.5/unittest.py", line 232, in shortDescription
> doc = self._testMethodDoc
> AttributeError: 'StartUpFailure' object has no attribute '_testMethodDoc'

This is a problem when you want to use zope.testing's test finding helpers to implement 'python setup.py test'.

Revision history for this message
Tres Seaver (tseaver) wrote :

I can verify that 'StartupFailure.__init__' still doesn't call the base class '__init__' on the zope.testrunner trunk.

Changed in zope.testing:
importance: Undecided → Medium
status: New → Confirmed
Roman Joost (romanofski)
Changed in zope.testing:
assignee: nobody → Roman Joost (romanofski-two)
Revision history for this message
Christian Theune (ctheune) wrote :

Marius: can you give a bit more information on how to reproduce this so we can write a test case? (or even better: give us a test case? :) )

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Here's a failing test that reproduces the problem.

(I'm extremely unhappy with putting it inside the already-horribly-too-long class docstring, but refactoring the test suite would just muddy the waters at this point, and I'm not up to it.)

Tres Seaver (tseaver)
Changed in zope.testrunner:
status: New → Confirmed
assignee: nobody → Tres Seaver (tseaver)
Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in zope.testrunner:
status: Confirmed → Fix Committed
importance: Undecided → Medium
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Context: https://mail.zope.org/pipermail/zope-dev/2008-April/031564.html

Timothy Selivanow found this bug trying to do 'python setup.py test' for ZConfig-2.5.1. I analyzed the traceback and decided to file this bug.

Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in zope.testrunner:
status: Fix Committed → Fix Released
Revision history for this message
Roman Joost (romanofski) wrote :

I committed the patch today into zope.testing@113633.

Changed in zope.testing:
status: Confirmed → Fix Committed
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

Fix released in zope.testing 3.10.0

Changed in zope.testing:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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