MCPcopy Index your code
hub / github.com/RustPython/RustPython / test

Method test

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

Source from the content-addressed store, hash-verified

2062 """
2063
2064 def test(self):
2065 parser = argparse.ArgumentParser()
2066 with self.assertRaises(TypeError) as cm:
2067 parser.add_argument('-x', type=argparse.FileType)
2068
2069 self.assertEqual(
2070 '%r is a FileType class object, instance of it must be passed'
2071 % (argparse.FileType,),
2072 str(cm.exception)
2073 )
2074
2075
2076class TestTypeCallable(ParserTestCase):

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
assertRaisesMethod · 0.45
add_argumentMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected