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

Method test_dict_iter

Lib/test/_test_multiprocessing.py:2525–2536  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2523 self.assertEqual(sorted(d.items()), [(i, chr(i)) for i in indices])
2524
2525 def test_dict_iter(self):
2526 d = self.dict()
2527 indices = list(range(65, 70))
2528 for i in indices:
2529 d[i] = chr(i)
2530 it = iter(d)
2531 self.assertEqual(list(it), indices)
2532 self.assertEqual(list(it), []) # exhausted
2533 # dictionary changed size during iteration
2534 it = iter(d)
2535 d.clear()
2536 self.assertRaises(RuntimeError, next, it)
2537
2538 def test_dict_proxy_nested(self):
2539 pets = self.dict(ferrets=2, hamsters=4)

Callers

nothing calls this directly

Calls 7

listClass · 0.85
chrFunction · 0.85
iterFunction · 0.85
dictMethod · 0.45
assertEqualMethod · 0.45
clearMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected