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