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

Method assertStructError

Lib/test/test_struct.py:340–343  ·  view source on GitHub ↗
(func, *args, **kwargs)

Source from the content-addressed store, hash-verified

338 def test_nN_code(self):
339 # n and N don't exist in standard sizes
340 def assertStructError(func, *args, **kwargs):
341 with self.assertRaises(struct.error) as cm:
342 func(*args, **kwargs)
343 self.assertIn("bad char in struct format", str(cm.exception))
344 for code in 'nN':
345 for byteorder in ('=', '<', '>', '!'):
346 format = byteorder+code

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
assertInMethod · 0.80
funcFunction · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected