From b87ef8f872b6c0df20f69579a68dfac6c2cf4eb2 Mon Sep 17 00:00:00 2001 From: Michael Foord Date: Mon, 22 Nov 2010 10:41:27 +0000 Subject: Improve test for 'python -m unittest' launching test discovery --- Lib/unittest/test/test_discovery.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py index 7c24bf8..5dcbda4 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): -- cgit v0.12