summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-12-19 03:59:10 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-12-19 03:59:10 (GMT)
commitf100dbd6009e18bb1ab14fa6da8732751b1a9add (patch)
treef4e8500aa979023c5c9b37a7d5ddbdcb6daebc8e /Lib/unittest/test
parentb3468f79efa45c8adaf86c0b9b797b9b3d4c12a2 (diff)
downloadcpython-f100dbd6009e18bb1ab14fa6da8732751b1a9add.zip
cpython-f100dbd6009e18bb1ab14fa6da8732751b1a9add.tar.gz
cpython-f100dbd6009e18bb1ab14fa6da8732751b1a9add.tar.bz2
Fix minor issue in implementation of issue 10470.
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/test_discovery.py13
-rw-r--r--Lib/unittest/test/test_program.py1
2 files changed, 14 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py
index 52a711a..e688f8e 100644
--- a/Lib/unittest/test/test_discovery.py
+++ b/Lib/unittest/test/test_discovery.py
@@ -231,6 +231,19 @@ class TestDiscovery(unittest.TestCase):
program.parseArgs(['something'])
self.assertTrue(self.called)
+ def test_command_line_handling_discover_by_default_with_options(self):
+ program = TestableTestProgram()
+ program.module = None
+
+ args = ['something', '-v', '-b', '-v', '-c', '-f']
+ self.called = False
+ def do_discovery(argv):
+ self.called = True
+ self.assertEqual(argv, args[1:])
+ program._do_discovery = do_discovery
+ program.parseArgs(args)
+ self.assertTrue(self.called)
+
def test_command_line_handling_do_discovery_too_many_arguments(self):
class Stop(Exception):
diff --git a/Lib/unittest/test/test_program.py b/Lib/unittest/test/test_program.py
index ec805cc..a50a245 100644
--- a/Lib/unittest/test/test_program.py
+++ b/Lib/unittest/test/test_program.py
@@ -99,6 +99,7 @@ class InitialisableProgram(unittest.TestProgram):
defaultTest = None
testRunner = None
testLoader = unittest.defaultTestLoader
+ module = '__main__'
progName = 'test'
test = 'test'
def __init__(self, *args):