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

Method test_isdisjoint

Lib/test/test_set.py:131–143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

129 self.assertNotEqual(id(s), id(z))
130
131 def test_isdisjoint(self):
132 def f(s1, s2):
133 'Pure python equivalent of isdisjoint()'
134 return not set(s1).intersection(s2)
135 for larg in '', 'a', 'ab', 'abc', 'ababac', 'cdc', 'cc', 'efgfe', 'ccb', 'ef':
136 s1 = self.thetype(larg)
137 for rarg in '', 'a', 'ab', 'abc', 'ababac', 'cdc', 'cc', 'efgfe', 'ccb', 'ef':
138 for C in set, frozenset, dict.fromkeys, str, list, tuple:
139 s2 = C(rarg)
140 actual = s1.isdisjoint(s2)
141 expected = f(s1, s2)
142 self.assertEqual(actual, expected)
143 self.assertTrue(actual is True or actual is False)
144
145 def test_and(self):
146 i = self.s.intersection(self.otherword)

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
CClass · 0.70
fFunction · 0.70
isdisjointMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected