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

Method test_arithmetic_Set

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

Source from the content-addressed store, hash-verified

1485 self.assertNotEqual(s2, s3)
1486
1487 def test_arithmetic_Set(self):
1488 class MySet(Set):
1489 def __init__(self, itr):
1490 self.contents = itr
1491 def __contains__(self, x):
1492 return x in self.contents
1493 def __iter__(self):
1494 return iter(self.contents)
1495 def __len__(self):
1496 return len([x for x in self.contents])
1497 s1 = MySet((1, 2, 3))
1498 s2 = MySet((3, 4, 5))
1499 s3 = s1 & s2
1500 self.assertEqual(s3, MySet((3,)))
1501
1502 def test_MutableSet(self):
1503 self.assertIsInstance(set(), MutableSet)

Callers

nothing calls this directly

Calls 2

MySetClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected