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

Method test_inplace_methods

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

Source from the content-addressed store, hash-verified

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'):
1839 for methname in ('update', 'intersection_update',
1840 'difference_update', 'symmetric_difference_update'):
1841 for g in (G, I, Ig, S, L, R):
1842 s = set('january')
1843 t = s.copy()
1844 getattr(s, methname)(list(g(data)))
1845 getattr(t, methname)(g(data))
1846 self.assertEqual(sorted(s, key=repr), sorted(t, key=repr))
1847
1848 self.assertRaises(TypeError, getattr(set('january'), methname), X(data))
1849 self.assertRaises(TypeError, getattr(set('january'), methname), N(data))
1850 self.assertRaises(ZeroDivisionError, getattr(set('january'), methname), E(data))
1851
1852class bad_eq:
1853 def __eq__(self, other):

Callers

nothing calls this directly

Calls 9

setFunction · 0.85
listClass · 0.85
gFunction · 0.70
XClass · 0.70
NClass · 0.70
EClass · 0.70
copyMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected