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

Method test_help

Lib/test/test_calendar.py:1120–1131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1118
1119 @support.force_not_colorized
1120 def test_help(self):
1121 stdout = self.run_cmd_ok('-h')
1122 self.assertIn(b'usage:', stdout)
1123 self.assertIn(b' -m calendar ', stdout)
1124 self.assertIn(b'--help', stdout)
1125
1126 # special case: stdout but sys.exit()
1127 with self.captured_stdout_with_buffer() as output:
1128 self.assertRaises(SystemExit, calendar.main, ['-h'])
1129 output = output.buffer.read()
1130 self.assertIn(b'usage:', output)
1131 self.assertIn(b'--help', output)
1132
1133 def test_illegal_arguments(self):
1134 self.assertFailure('-z')

Callers

nothing calls this directly

Calls 5

run_cmd_okMethod · 0.95
assertInMethod · 0.80
assertRaisesMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected