Issue 10470: 'python -m unittest' launches test discovery by default.(If you need to pass options to test discovery the discover subcommand must still be specified explicitly.)

This commit is contained in:
Michael Foord 2010-11-21 21:28:01 +00:00
parent 47c74ac977
commit 086f30815c
5 changed files with 54 additions and 14 deletions

View file

@ -109,7 +109,8 @@ class TestProgram(object):
sys.exit(2)
def parseArgs(self, argv):
if len(argv) > 1 and argv[1].lower() == 'discover':
if ((len(argv) > 1 and argv[1].lower() == 'discover') or
(len(argv) == 1 and self.module is None)):
self._do_discovery(argv[2:])
return