| Store | Cart

Re: [Python-Dev] unittest test discovery and namespace packages

From: Robert Collins <robe...@robertcollins.net>
Sat, 18 Apr 2015 06:47:19 +1200
On 17 April 2015 at 19:40, Alex Shkop <a.v....@gmail.com> wrote:
> 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/.

I don't think that 'scan the global namespace' makes a sensible
default definition.

The behaviour of discovery with namespace packages today requires some
key to select the namespace - either a locally discovered directory,
which happens to be a namespace package, or the name of the package to
process.

Since discovery is recursive, sub namespace packages should work, but
I note there are no explicit tests to this effect.

I'm sorry I didn't respond earlier on the tracker, didn't see the
issue in my inbox for some reason. Lets discuss there.

-Rob


-- 
Robert Collins <rbtc...@hp.com>
Distinguished Technologist
HP Converged Cloud
_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Alex Shkop Apr 17, 2015 07:40 am
Robert Collins Apr 17, 2015 06:47 pm
Messages in this thread