(self)
| 254 | iprc(test_case.format(val=val)) |
| 255 | |
| 256 | def test_in_func_no_error(self): |
| 257 | # Test that the implementation of top-level return/yield |
| 258 | # detection isn't *too* aggressive, and works inside a function |
| 259 | func_contexts = [] |
| 260 | |
| 261 | func_contexts.append( |
| 262 | ( |
| 263 | "func", |
| 264 | False, |
| 265 | dedent( |
| 266 | """ |
| 267 | def f():""" |
| 268 | ), |
| 269 | ) |
| 270 | ) |
| 271 | |
| 272 | func_contexts.append( |
| 273 | ( |
| 274 | "method", |
| 275 | False, |
| 276 | dedent( |
| 277 | """ |
| 278 | class MyClass: |
| 279 | def __init__(self): |
| 280 | """ |
| 281 | ), |
| 282 | ) |
| 283 | ) |
| 284 | |
| 285 | func_contexts.append( |
| 286 | ( |
| 287 | "async-func", |
| 288 | True, |
| 289 | dedent( |
| 290 | """ |
| 291 | async def f():""" |
| 292 | ), |
| 293 | ) |
| 294 | ) |
| 295 | |
| 296 | func_contexts.append( |
| 297 | ( |
| 298 | "async-method", |
| 299 | True, |
| 300 | dedent( |
| 301 | """ |
| 302 | class MyClass: |
| 303 | async def f(self):""" |
| 304 | ), |
| 305 | ) |
| 306 | ) |
| 307 | |
| 308 | func_contexts.append( |
| 309 | ( |
| 310 | "closure", |
| 311 | False, |
| 312 | dedent( |
| 313 | """ |
nothing calls this directly
no test coverage detected