| 2978 | |
| 2979 | @support.requires_resource('cpu') |
| 2980 | def test_jump_extended_args_for_iter(self): |
| 2981 | # In addition to failing when extended arg handling is broken, this can |
| 2982 | # also hang for a *very* long time: |
| 2983 | source = [ |
| 2984 | "def f(output):", |
| 2985 | " output.append(1)", |
| 2986 | " for _ in spam:", |
| 2987 | *(f" output.append({i})" for i in range(3, 100_000)), |
| 2988 | f" output.append(100_000)", |
| 2989 | ] |
| 2990 | namespace = {} |
| 2991 | exec("\n".join(source), namespace) |
| 2992 | f = namespace["f"] |
| 2993 | self.run_test(f, 2, 100_000, [1, 100_000], warning=(RuntimeWarning, self.unbound_locals)) |
| 2994 | |
| 2995 | @jump_test(2, 3, [1, 3], warning=(RuntimeWarning, unbound_locals)) |
| 2996 | def test_jump_or_pop(output): |