MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_accumulate

Method test_accumulate

Lib/test/test_itertools.py:2162–2171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2160class TestVariousIteratorArgs(unittest.TestCase):
2161
2162 def test_accumulate(self):
2163 s = [1,2,3,4,5]
2164 r = [1,3,6,10,15]
2165 n = len(s)
2166 for g in (G, I, Ig, L, R):
2167 self.assertEqual(list(accumulate(g(s))), r)
2168 self.assertEqual(list(accumulate(S(s))), [])
2169 self.assertRaises(TypeError, accumulate, X(s))
2170 self.assertRaises(TypeError, accumulate, N(s))
2171 self.assertRaises(ZeroDivisionError, list, accumulate(E(s)))
2172
2173 def test_batched(self):
2174 s = 'abcde'

Callers

nothing calls this directly

Calls 9

lenFunction · 0.85
listClass · 0.85
gFunction · 0.70
SClass · 0.70
XClass · 0.70
NClass · 0.70
EClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected