From: Michael Foord Date: Mon, 22 Nov 2010 10:41:27 +0000 (+0000) Subject: Improve test for 'python -m unittest' launching test discovery X-Git-Tag: v3.2b1~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b87ef8f872b6c0df20f69579a68dfac6c2cf4eb2;p=python Improve test for 'python -m unittest' launching test discovery --- diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py index 7c24bf832d..5dcbda455e 100644 --- a/Lib/unittest/test/test_discovery.py +++ b/Lib/unittest/test/test_discovery.py @@ -223,15 +223,14 @@ class TestDiscovery(unittest.TestCase): 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):