summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/main.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-11-21 21:28:01 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-11-21 21:28:01 (GMT)
commit086f30815c0f674326fe78ba83689d0a2a96b8d7 (patch)
tree3c9ae9c0afa50d255f093cf730cafefbd5751efd /Lib/unittest/main.py
parent47c74ac97798950d3fbe973d0b9b9f292ae76eab (diff)
downloadcpython-086f30815c0f674326fe78ba83689d0a2a96b8d7.zip
cpython-086f30815c0f674326fe78ba83689d0a2a96b8d7.tar.gz
cpython-086f30815c0f674326fe78ba83689d0a2a96b8d7.tar.bz2
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.)
Diffstat (limited to 'Lib/unittest/main.py')
-rw-r--r--Lib/unittest/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
index 6acff8f..8473a33 100644
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -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