Improve test for 'python -m unittest' launching test discovery

This commit is contained in:
Michael Foord 2010-11-22 10:41:27 +00:00
parent 5cbc71e50a
commit b87ef8f872
1 changed files with 4 additions and 5 deletions

View File

@ -223,15 +223,14 @@ def test_command_line_handling_discover_by_default(self):
program = TestableTestProgram()
program.module = None
args = []
self.called = False
def do_discovery(argv):
args.extend(argv)
self.called = True
self.assertEqual(argv, [])
program._do_discovery = do_discovery
program.parseArgs(['something'])
self.assertEqual(args, [])
self.assertTrue(self.called)
program.parseArgs(['something'])
self.assertEqual(args, [])
def test_command_line_handling_do_discovery_too_many_arguments(self):
class Stop(Exception):