MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_abc_bases

Method test_abc_bases

Lib/test/test_typing.py:4902–4919  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4900 self.assertNotIsSubclass(dict, MyMapping)
4901
4902 def test_abc_bases(self):
4903 class MM(MutableMapping[str, str]):
4904 def __getitem__(self, k):
4905 return None
4906 def __setitem__(self, k, v):
4907 pass
4908 def __delitem__(self, k):
4909 pass
4910 def __iter__(self):
4911 return iter(())
4912 def __len__(self):
4913 return 0
4914 # this should just work
4915 MM().update()
4916 self.assertIsInstance(MM(), collections.abc.MutableMapping)
4917 self.assertIsInstance(MM(), MutableMapping)
4918 self.assertNotIsInstance(MM(), List)
4919 self.assertNotIsInstance({}, MM)
4920
4921 def test_multiple_bases(self):
4922 class MM1(MutableMapping[str, str], collections.abc.MutableMapping):

Callers

nothing calls this directly

Calls 4

assertIsInstanceMethod · 0.80
assertNotIsInstanceMethod · 0.80
MMClass · 0.70
updateMethod · 0.45

Tested by

no test coverage detected