nose-devs/nose — Issue #42: Test discovery errors crash nose
Author: jpellerin
Created: 2011-12-14 15:56:37+00:00
State: open

I thought I'd submitted this on Friday, sorry if it shows up twice...

What steps will reproduce the problem?
1. nosetests doctest.py

What is the expected output? What do you see instead?

Expected: nose-reported errors, logged by .addError.
Got: traceback (other failures are possible with different plugins
active):

/home/john/src/nose/nose/case.py:321: DeprecationWarning: class Tester is
deprecated; use class doctest.DocTestRunner instead
self.inst = self.cls()
Traceback (most recent call last):
File "/usr/bin/nosetests", line 8, in
load_entry_point('nose==0.10.0b1', 'console_scripts', 'nosetests')()
File "/home/john/src/nose/nose/core.py", line 188, in __init__
argv=argv, testRunner=testRunner, testLoader=testLoader)
File "/usr/lib/python2.5/unittest.py", line 767, in __init__
self.parseArgs(argv)
File "/home/john/src/nose/nose/core.py", line 236, in parseArgs
self.createTests()
File "/home/john/src/nose/nose/core.py", line 249, in createTests
self.test = self.testLoader.loadTestsFromNames(self.testNames)
File "/home/john/src/nose/nose/loader.py", line 408, in
loadTestsFromNames
return unittest.TestLoader.loadTestsFromNames(self, names, module)
File "/usr/lib/python2.5/unittest.py", line 565, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/home/john/src/nose/nose/loader.py", line 363, in
loadTestsFromName
module, discovered=discovered)
File "/home/john/src/nose/nose/loader.py", line 280, in
loadTestsFromModule
test_classes + test_funcs)
File "/home/john/src/nose/nose/loader.py", line 279, in
tests = map(lambda t: self.makeTest(t, parent=module),
File "/home/john/src/nose/nose/loader.py", line 486, in makeTest
return self.loadTestsFromTestClass(obj)
File "/home/john/src/nose/nose/loader.py", line 449, in
loadTestsFromTestClass
for case in filter(wanted, dir(cls))]
File "/home/john/src/nose/nose/loader.py", line 496, in makeTest
return MethodTestCase(obj)
File "/home/john/src/nose/nose/case.py", line 321, in __init__
self.inst = self.cls()
File "doctest.py", line 1970, in __init__

TypeError: Tester.__init__: must specify mod or globs

What version of the product are you using? On what operating system?

http://python-nose.googlecode.com/svn/branches/0.10.0-stable revision 309.
Ubuntu Linux.

Please provide any additional information below.

Obviously these particular Python files didn't expect to have their tests
discovered by nose. I expected errors during test discovery to be
reported the same way as errors in running discovered tests. It seems
that doesn't (always?) happen. Would a patch be accepted, or is this
regarded as preferable behaviour?

Google Code Info:
Issue #: 86
Author: j...@pobox.com
Created On: 2007-09-02T19:36:33.000Z
Closed On: