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

Method test_Container

Lib/test/test_collections.py:1341–1357  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1339 self.validate_isinstance(Sized, '__len__')
1340
1341 def test_Container(self):
1342 non_samples = [None, 42, 3.14, 1j,
1343 _test_gen(),
1344 (x for x in []),
1345 ]
1346 for x in non_samples:
1347 self.assertNotIsInstance(x, Container)
1348 self.assertNotIsSubclass(type(x), Container)
1349 samples = [bytes(), str(),
1350 tuple(), list(), set(), frozenset(), dict(),
1351 dict().keys(), dict().items(),
1352 ]
1353 for x in samples:
1354 self.assertIsInstance(x, Container)
1355 self.assertIsSubclass(type(x), Container)
1356 self.validate_abstract_methods(Container, '__contains__')
1357 self.validate_isinstance(Container, '__contains__')
1358
1359 def test_Callable(self):
1360 non_samples = [None, 42, 3.14, 1j,

Callers

nothing calls this directly

Calls 12

_test_genFunction · 0.85
strFunction · 0.85
listClass · 0.85
setFunction · 0.85
assertNotIsInstanceMethod · 0.80
assertIsInstanceMethod · 0.80
validate_isinstanceMethod · 0.80
assertNotIsSubclassMethod · 0.45
keysMethod · 0.45
itemsMethod · 0.45
assertIsSubclassMethod · 0.45

Tested by

no test coverage detected