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

Method test_init

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

Source from the content-addressed store, hash-verified

2149 self.assertEqual(c[key], 1)
2150
2151 def test_init(self):
2152 self.assertEqual(list(Counter(self=42).items()), [('self', 42)])
2153 self.assertEqual(list(Counter(iterable=42).items()), [('iterable', 42)])
2154 self.assertEqual(list(Counter(iterable=None).items()), [('iterable', None)])
2155 self.assertRaises(TypeError, Counter, 42)
2156 self.assertRaises(TypeError, Counter, (), ())
2157 self.assertRaises(TypeError, Counter.__init__)
2158
2159 def test_total(self):
2160 c = Counter(a=10, b=5, c=0)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected