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

Method test_items_symmetric_difference

Lib/test/test_dict.py:807–815  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

805 self.assertEqual(k1 ^ k3, {(1,1), (2,2), (4,4)})
806
807 def test_items_symmetric_difference(self):
808 rr = random.randrange
809 for _ in range(100):
810 left = {x:rr(3) for x in range(20) if rr(2)}
811 right = {x:rr(3) for x in range(20) if rr(2)}
812 with self.subTest(left=left, right=right):
813 expected = set(left.items()) ^ set(right.items())
814 actual = left.items() ^ right.items()
815 self.assertEqual(actual, expected)
816
817 def test_dictview_mixed_set_operations(self):
818 # Just a few for .keys()

Callers

nothing calls this directly

Calls 5

rrFunction · 0.85
setFunction · 0.85
subTestMethod · 0.45
itemsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected