From d7e8e3444fbc9bdaddb3c725c03558cfec5b9039 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 2 May 2009 16:24:37 +0000 Subject: [PATCH] don't let sys.argv be used in the tests --- Lib/test/test_unittest.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index bff599983db..bb534fcd0a0 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -3085,8 +3085,9 @@ class Test_TestProgram(TestCase): def test_NonExit(self): program = unittest.main(exit=False, - testRunner=unittest.TextTestRunner(stream=StringIO()), - testLoader=self.FooBarLoader()) + argv=["foobar"], + testRunner=unittest.TextTestRunner(stream=StringIO()), + testLoader=self.FooBarLoader()) self.assertTrue(hasattr(program, 'result')) @@ -3094,6 +3095,7 @@ class Test_TestProgram(TestCase): self.assertRaises( SystemExit, unittest.main, + argv=["foobar"], testRunner=unittest.TextTestRunner(stream=StringIO()), exit=True, testLoader=self.FooBarLoader()) @@ -3103,6 +3105,7 @@ class Test_TestProgram(TestCase): self.assertRaises( SystemExit, unittest.main, + argv=["foobar"], testRunner=unittest.TextTestRunner(stream=StringIO()), testLoader=self.FooBarLoader())