[issue23882] unittest discovery and namespaced packages

2015-04-20 Thread Alex Shkop
Alex Shkop added the comment: This script creates following directory structure issue_23882\ tests\ test_fail.py If you run from issue_23882 directory python -m unittest it doesn't find any tests. If there is __init__.py inside tests folder, same command finds test_fail.py and runs it.

[issue23882] unittest discovery and namespaced packages

2015-04-17 Thread Robert Collins
Robert Collins added the comment: Hi. I'd be happy enough to use pkgutil helpers if they (like walkdirs) allowed trimming the output: part of the definition of discovery is that one can control it, to stop it importing or processing part of the tree that one doesn't want processed. Alex: can

[issue23882] unittest discovery and namespaced packages

2015-04-17 Thread Alex Shkop
Alex Shkop added the comment: Not fully. Patch for issue17457 fixed discovery when you explicitly specified namespace package as a target for discovery. I.e. when you run python -m unittest namespace_pkg But it didn't recurse into any namespace packages inside namespace_pkg. So when you run

[issue23882] unittest discovery and namespaced packages

2015-04-17 Thread Claudiu Popa
Claudiu Popa added the comment: Isn't this already supported by the patch added in issue17457? -- nosy: +Claudiu.Popa ___ Python tracker ___ _

[issue23882] unittest discovery and namespaced packages

2015-04-08 Thread Eric Snow
Eric Snow added the comment: Is there any reason for unittest to not use pkgutil.iter_modules or pkgutil.walk_packages? Either should work. -- ___ Python tracker ___ __

[issue23882] unittest discovery and namespaced packages

2015-04-08 Thread Alex Shkop
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 importab

[issue23882] unittest discovery and namespaced packages

2015-04-07 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue23882] unittest discovery and namespaced packages

2015-04-07 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, michael.foord, rbcollins type: -> behavior ___ Python tracker ___ ___ Python-bugs-l

[issue23882] unittest discovery and namespaced packages

2015-04-07 Thread Florian Apolloner
New submission from Florian Apolloner: Unittest discovery does not seem to work if the tests package is a namespace package. The attached file should have all details to reproduce, as soon as I readd an __init__.py everything works fine. Test was done using python3.4.2 and 3.4.3 --