mirror of https://github.com/python/cpython.git
Improve test for 'python -m unittest' launching test discovery
This commit is contained in:
parent
5cbc71e50a
commit
b87ef8f872
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue