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

Method check_for_loop

Lib/test/test_iter.py:123–129  ·  view source on GitHub ↗
(self, expr, seq, pickle=True)

Source from the content-addressed store, hash-verified

121
122 # Helper to check that a for loop generates a given sequence
123 def check_for_loop(self, expr, seq, pickle=True):
124 if pickle:
125 self.check_pickle(iter(expr), seq)
126 res = []
127 for val in expr:
128 res.append(val)
129 self.assertEqual(res, seq)
130
131 # Helper to check picklability
132 def check_pickle(self, itorg, seq):

Callers 11

test_iter_for_loopMethod · 0.95
test_iter_class_forMethod · 0.95
test_seq_class_forMethod · 0.95
test_stop_sequenceMethod · 0.95
test_iter_big_rangeMethod · 0.95
test_iter_emptyMethod · 0.95
test_iter_tupleMethod · 0.95
test_iter_rangeMethod · 0.95
test_iter_stringMethod · 0.95
test_iter_dictMethod · 0.95
test_iter_fileMethod · 0.95

Calls 3

check_pickleMethod · 0.95
assertEqualMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected