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

Method test_update

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

Source from the content-addressed store, hash-verified

2223 self.assertTrue(correctly_ordered(p))
2224
2225 def test_update(self):
2226 c = Counter()
2227 c.update(self=42)
2228 self.assertEqual(list(c.items()), [('self', 42)])
2229 c = Counter()
2230 c.update(iterable=42)
2231 self.assertEqual(list(c.items()), [('iterable', 42)])
2232 c = Counter()
2233 c.update(iterable=None)
2234 self.assertEqual(list(c.items()), [('iterable', None)])
2235 self.assertRaises(TypeError, Counter().update, 42)
2236 self.assertRaises(TypeError, Counter().update, {}, {})
2237 self.assertRaises(TypeError, Counter.update)
2238
2239 def test_copying(self):
2240 # Check that counters are copyable, deepcopyable, picklable, and

Callers

nothing calls this directly

Calls 6

updateMethod · 0.95
CounterClass · 0.90
listClass · 0.85
assertEqualMethod · 0.45
itemsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected