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

Method test_Container

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

Source from the content-addressed store, hash-verified

1340 self.validate_isinstance(Sized, '__len__')
1341
1342 def test_Container(self):
1343 non_samples = [None, 42, 3.14, 1j,
1344 _test_gen(),
1345 (x for x in []),
1346 ]
1347 for x in non_samples:
1348 self.assertNotIsInstance(x, Container)
1349 self.assertNotIsSubclass(type(x), Container)
1350 samples = [bytes(), str(),
1351 tuple(), list(), set(), frozenset(), dict(),
1352 dict().keys(), dict().items(),
1353 ]
1354 for x in samples:
1355 self.assertIsInstance(x, Container)
1356 self.assertIsSubclass(type(x), Container)
1357 self.validate_abstract_methods(Container, '__contains__')
1358 self.validate_isinstance(Container, '__contains__')
1359
1360 def test_Callable(self):
1361 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
assertNotIsSubclassMethod · 0.80
assertIsInstanceMethod · 0.80
assertIsSubclassMethod · 0.80
validate_isinstanceMethod · 0.80
keysMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected