-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test discovery errors crash nose #42
Comments
A patch would be great. Errors during discovery should always (for reasonable cases) Google Code Info: |
I have added a patch which fixes this error (with test case!) Open questions about the patch:
Unfortunately, nosetests doctest.py still fails, but gets further: y/home/localjames/svn/nose/nose/case.py:320: DeprecationWarning: class Tester is Google Code Info: |
The latest error seems to be due to the fact that some instances of DocTestCase are class DocTestCase(unittest.TestCase):
so the "test" argument is a string. I will carry on looking for the point where Google Code Info: |
This affects unittest as well. Not sure this is an excuse, since unittest won't get james@palermo:/home/localjames/svn/nose/sandbox$ cat test_doctest.py TestDoc = doctest.DocTestCase if name == "main": james@palermo:/home/localjames/svn/nose/sandbox$ python test_doctest.py EETraceback (most recent call last): Google Code Info: |
Well this patch fixes it. I'm not sure this second patch should go in as it addresses the very marginal case Google Code Info: |
I'm going to reopen but postpone for post 0.10.0. What I'm thinking right now is that loadTestsFromNames() is going to have to wrap Google Code Info: |
Has this got forgotten? Google Code Info: |
Google Code Info: |
Wrapping the .loadTestsFromName() call in .loadTestsFromNames() fails to catch this, Google Code Info: |
I need to think about this one some more. If laziness goes away, as we've discussed I I'm going to put this under 0.11 for now to hold it open for more discussion. Google Code Info: |
I'm sure it would make it easier to think about. As I say, I didn't really try to figure it out, and I'm sure you know better than I Google Code Info: |
Pushing this to post-1.0, when test loading stops being lazy. Google Code Info: |
I thought I'd submitted this on Friday, sorry if it shows up twice...
What steps will reproduce the problem?
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: [email protected]
Created On: 2007-09-02T19:36:33.000Z
Closed On:
The text was updated successfully, but these errors were encountered: