testing-cabal / unittest-ext

Automatically exported from code.google.com/p/unittest-ext
2 stars 2 forks source link

Critical Bug - Django tests cannot be loaded with unittest 2 0.8.0 #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

Django version 1.6.7, unittest2 version 0.8.0

Line 413 of unittest2/loader.py:
the function self._find_test_path() can return None, but on the same it is 
assigned to a tuple. So when it happens that the function returns None, an 
exception is raised 8and not catched at all): "TypeError: 'NoneType' object is 
not iterable".

Fix is easy (I aleady made it: if the result is None set the tuple to (None, 
None)) but is pretty urgent I think.

Cheers,
Stefano.

Original issue reported on code.google.com by stefano....@gmail.com on 28 Nov 2014 at 3:45

Attachments:

GoogleCodeExporter commented 9 years ago
Found the reason: there is a symbolic link in the one of the paths where 
unittest2 search the tests. Django is therefore not the reason. So to make it 
reproducible it should be enough to create a symbolyc link somewhere in the 
paths scanned for tests. You will see the error then.

Original comment by stefano....@gmail.com on 28 Nov 2014 at 4:37

GoogleCodeExporter commented 9 years ago
Sorry, to make it reproducible you have to create a *broken* symbolyc link 
somewhere in the paths scanned for tests.

So it is not a critical bug, but I think it should be fixed, or at least a 
clear error message should be reported stating that an error has occured when 
trying to access file/dir "x".

Cheers and sorry for the triple-post,
Stefano.

Original comment by stefano....@gmail.com on 28 Nov 2014 at 4:59

GoogleCodeExporter commented 9 years ago
I'd be delighted to fix this. It sounds like it will affect upstream cPython 
unittest too - can I ask therefore that you file a ticket in the cPython ticket 
tracker (and reference it here)? Thanks!

Original comment by robert.c...@gmail.com on 12 Mar 2015 at 2:48