Alex Shkop added the comment:

Spent some time looking into this one. Looks like the problem is in 
TestLoader.discover() method. There are couple of issues I found in it, all 
caused by same assumption.

Documentation [1] states that all test modules found by discover() method 
should be importable from top_level_dir. Whenever this method finds a 
subdirectory of start_dir it checks for __init__.py file. If there's no 
__init__.py then finder assumes that files within this package is not 
importable and stops recursion. This kind of 'importablity' check is not valid 
since we have namespace packages.

I'm not sure what should be done to fix this issue. We can change documentation 
to state that only regular packages with tests will be discovered. Or we can 
fix 'importability' checks, which will mean that all tests in all 
subdirectories will be discovered.

[1] 
https://docs.python.org/3.4/library/unittest.html#unittest.TestLoader.discover

----------
nosy: +ashkop

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23882>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to