MCPcopy Index your code
hub / github.com/python/cpython / assertHelpEquals

Method assertHelpEquals

Lib/test/test_optparse.py:1506–1513  ·  view source on GitHub ↗
(self, expected_output)

Source from the content-addressed store, hash-verified

1504 return InterceptingOptionParser(option_list=options)
1505
1506 def assertHelpEquals(self, expected_output):
1507 save_argv = sys.argv[:]
1508 try:
1509 # Make optparse believe bar.py is being executed.
1510 sys.argv[0] = os.path.join("foo", "bar.py")
1511 self.assertOutput(["-h"], expected_output)
1512 finally:
1513 sys.argv[:] = save_argv
1514
1515 def test_help(self):
1516 self.assertHelpEquals(_expected_help_basic)

Callers 8

test_helpMethod · 0.95
test_help_old_usageMethod · 0.95
test_wrap_columnsMethod · 0.95
test_help_unicodeMethod · 0.95

Calls 2

assertOutputMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected