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

Method test_inline_methods

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

Source from the content-addressed store, hash-verified

1820 self.assertRaises(ZeroDivisionError, cons , E(s))
1821
1822 def test_inline_methods(self):
1823 s = set('november')
1824 for data in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5), 'december'):
1825 for meth in (s.union, s.intersection, s.difference, s.symmetric_difference, s.isdisjoint):
1826 for g in (G, I, Ig, L, R):
1827 expected = meth(data)
1828 actual = meth(g(data))
1829 if isinstance(expected, bool):
1830 self.assertEqual(actual, expected)
1831 else:
1832 self.assertEqual(sorted(actual, key=repr), sorted(expected, key=repr))
1833 self.assertRaises(TypeError, meth, X(s))
1834 self.assertRaises(TypeError, meth, N(s))
1835 self.assertRaises(ZeroDivisionError, meth, E(s))
1836
1837 def test_inplace_methods(self):
1838 for data in ("123", "", range(1000), ('do', 1.2), range(2000,2200,5), 'december'):

Callers

nothing calls this directly

Calls 8

setFunction · 0.85
methFunction · 0.85
gFunction · 0.70
XClass · 0.70
NClass · 0.70
EClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected