[issue8324] add a distutils test command

Michael Foord report at bugs.python.org
Sun May 9 14:40:18 CEST 2010


Michael Foord <michael at voidspace.org.uk> added the comment:

unittest2 is used for distutils2 development, but *not* a required dependency for *using* distutils2 (if I understand correctly(.

Well, if there is no test runner and no test suite specified but the test command is invoked then the steps should probably be something like:

* If Python version 2.7+ or 3.2+ then use test discovery from unittest
* If Python version 3.0, 3.1 or 2.6- then attempt to import unittest2 and do test discovery
* Otherwise do nothing

Test discovery is done with unittest(2).TestLoader.discover(...)

If a specific test runner or suite is provided then distutils2 should use those and need not attempt test discovery (again - my understanding).

So test discovery is a useful default if no test command is configured for a project. We may also want ways to configure that (for example allow a project to have test discovery for its test command but provide a different pattern for finding test files).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8324>
_______________________________________


More information about the Python-bugs-list mailing list