mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
don't let sys.argv be used in the tests
This commit is contained in:
parent
829f6b8052
commit
d7e8e3444f
1 changed files with 5 additions and 2 deletions
|
@ -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())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue