summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-11-22 10:41:27 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-11-22 10:41:27 (GMT)
commitb87ef8f872b6c0df20f69579a68dfac6c2cf4eb2 (patch)
tree686015234308c6d1c186b3551c181aeb931711ae /Lib/unittest
parent5cbc71e50ab6fa8c3cb0cfc64ca4bf5fb174ffcc (diff)
downloadcpython-b87ef8f872b6c0df20f69579a68dfac6c2cf4eb2.zip
cpython-b87ef8f872b6c0df20f69579a68dfac6c2cf4eb2.tar.gz
cpython-b87ef8f872b6c0df20f69579a68dfac6c2cf4eb2.tar.bz2
Improve test for 'python -m unittest' launching test discovery
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/test/test_discovery.py9
1 files 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):