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

Method test_skipitem_with_suffix

Lib/test/test_capi/test_getargs.py:1199–1228  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1197 self.assertIs(when_skipped, when_not_skipped, message)
1198
1199 def test_skipitem_with_suffix(self):
1200 parse = _testcapi.parse_tuple_and_keywords
1201 empty_tuple = ()
1202 tuple_1 = (0,)
1203 dict_b = {'b':1}
1204 keywords = ["a", "b"]
1205
1206 supported = ('s#', 's*', 'z#', 'z*', 'y#', 'y*', 'w*')
1207 for c in string.ascii_letters:
1208 for c2 in '#*':
1209 f = c + c2
1210 with self.subTest(format=f):
1211 optional_format = "|" + f + "i"
1212 if f in supported:
1213 parse(empty_tuple, dict_b, optional_format, keywords)
1214 else:
1215 with self.assertRaisesRegex(SystemError,
1216 'impossible<bad format char>'):
1217 parse(empty_tuple, dict_b, optional_format, keywords)
1218
1219 for c in map(chr, range(32, 128)):
1220 f = 'e' + c
1221 optional_format = "|" + f + "i"
1222 with self.subTest(format=f):
1223 if c in 'st':
1224 parse(empty_tuple, dict_b, optional_format, keywords)
1225 else:
1226 with self.assertRaisesRegex(SystemError,
1227 'impossible<bad format char>'):
1228 parse(empty_tuple, dict_b, optional_format, keywords)
1229
1230
1231class ParseTupleAndKeywords_Test(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

assertRaisesRegexMethod · 0.80
parseFunction · 0.50
subTestMethod · 0.45

Tested by

no test coverage detected