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

Class BadMapping

Lib/test/test_str.py:1456–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454 self.assertRaises(ValueError, '{a} {}'.format_map, {"a" : 2, "b" : 1})
1455
1456 class BadMapping:
1457 def __getitem__(self, key):
1458 return 1/0
1459 self.assertRaises(KeyError, '{a}'.format_map, {})
1460 self.assertRaises(TypeError, '{a}'.format_map, [])
1461 self.assertRaises(ZeroDivisionError, '{a}'.format_map, BadMapping())

Callers 1

test_format_mapMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_format_mapMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…