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

Method test_const

Lib/test/test_argparse.py:813–819  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

811 ]
812
813 def test_const(self):
814 # See bpo-40862
815 parser = argparse.ArgumentParser()
816 with self.assertRaises(TypeError) as cm:
817 parser.add_argument('--foo', const=True, action=argparse.BooleanOptionalAction)
818
819 self.assertIn("got an unexpected keyword argument 'const'", str(cm.exception))
820
821 def test_invalid_name(self):
822 parser = argparse.ArgumentParser()

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
assertInMethod · 0.80
assertRaisesMethod · 0.45
add_argumentMethod · 0.45

Tested by

no test coverage detected