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

Method test_isdisjoint_Set

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

Source from the content-addressed store, hash-verified

1448 self.assertTrue(hash(a) == hash(b))
1449
1450 def test_isdisjoint_Set(self):
1451 class MySet(Set):
1452 def __init__(self, itr):
1453 self.contents = itr
1454 def __contains__(self, x):
1455 return x in self.contents
1456 def __iter__(self):
1457 return iter(self.contents)
1458 def __len__(self):
1459 return len([x for x in self.contents])
1460 s1 = MySet((1, 2, 3))
1461 s2 = MySet((4, 5, 6))
1462 s3 = MySet((1, 5, 6))
1463 self.assertTrue(s1.isdisjoint(s2))
1464 self.assertFalse(s1.isdisjoint(s3))
1465
1466 def test_equality_Set(self):
1467 class MySet(Set):

Callers

nothing calls this directly

Calls 4

assertTrueMethod · 0.80
assertFalseMethod · 0.80
MySetClass · 0.70
isdisjointMethod · 0.45

Tested by

no test coverage detected