mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Refactor unittest command line handling to always use optparse
This commit is contained in:
parent
518cf94ad7
commit
5f99ced092
2 changed files with 32 additions and 59 deletions
|
@ -131,23 +131,6 @@ class TestCommandLineArgs(unittest.TestCase):
|
|||
FakeRunner.test = None
|
||||
FakeRunner.raiseError = False
|
||||
|
||||
def testHelpAndUnknown(self):
|
||||
program = self.program
|
||||
def usageExit(msg=None):
|
||||
program.msg = msg
|
||||
program.exit = True
|
||||
program.usageExit = usageExit
|
||||
|
||||
for opt in '-h', '-H', '--help':
|
||||
program.exit = False
|
||||
program.parseArgs([None, opt])
|
||||
self.assertTrue(program.exit)
|
||||
self.assertIsNone(program.msg)
|
||||
|
||||
program.parseArgs([None, '-$'])
|
||||
self.assertTrue(program.exit)
|
||||
self.assertIsNotNone(program.msg)
|
||||
|
||||
def testVerbosity(self):
|
||||
program = self.program
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue