(self)
| 234 | ]) |
| 235 | |
| 236 | def test_generator(self): |
| 237 | def f(): |
| 238 | for i in range(2): |
| 239 | yield i |
| 240 | def g(p): |
| 241 | for i in f(): |
| 242 | pass |
| 243 | f_ident = ident(f) |
| 244 | g_ident = ident(g) |
| 245 | self.check_events(g, [(1, 'call', g_ident), |
| 246 | # call the iterator twice to generate values |
| 247 | (2, 'call', f_ident), |
| 248 | (2, 'return', f_ident), |
| 249 | (2, 'call', f_ident), |
| 250 | (2, 'return', f_ident), |
| 251 | # once more; returns end-of-iteration with |
| 252 | # actually raising an exception |
| 253 | (2, 'call', f_ident), |
| 254 | (2, 'return', f_ident), |
| 255 | (1, 'return', g_ident), |
| 256 | ]) |
| 257 | |
| 258 | def test_stop_iteration(self): |
| 259 | def f(): |
nothing calls this directly
no test coverage detected