[Python-Dev] unittest test discovery and namespace packages (original) (raw)

Alex Shkop a.v.shkop at gmail.com
Fri Apr 17 09:40:14 CEST 2015


Hello!

There's an issue considering test discovery in unittest module. Basically it is about unittest module that doesn't find tests in namespace packages. For more info see issue http://bugs.python.org/issue23882.

I'm willing to make a patch for this bug. But I need help to formulate how test discovery should work.

Documentation states that all importable modules that match pattern will be loaded. This means that test modules inside namespace packages should be loaded too. But enabling this would change things drastically. For example now, running

python -m unittest

inside cpython source root does nothing. If we will enable test discovery inside namespace packages then this command will start running the whole python test suite in Lib/test/.

So I'm looking for someone's help to clarify how test discovery should work.

Thanks, Alex

Issue in bugtracker - http://bugs.python.org/issue23882 Documentation for discover() method - https://docs.python.org/3.4/library/unittest.html#unittest.TestLoader.discover -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150417/81fdab4b/attachment.html>



More information about the Python-Dev mailing list