The return type of the wrapped converter is copied into its __call__ and ultimately into pipe's wrapped converter.
(self)
| 276 | assert o is pipe()(o) |
| 277 | |
| 278 | def test_wrapped_annotation(self): |
| 279 | """ |
| 280 | The return type of the wrapped converter is copied into its __call__ |
| 281 | and ultimately into pipe's wrapped converter. |
| 282 | """ |
| 283 | |
| 284 | def last(value) -> bool: |
| 285 | return bool(value) |
| 286 | |
| 287 | @attr.s |
| 288 | class C: |
| 289 | x = attr.ib(converter=[Converter(int), Converter(last)]) |
| 290 | |
| 291 | i = C(5) |
| 292 | |
| 293 | assert True is i.x |
| 294 | assert ( |
| 295 | bool |
| 296 | is _AnnotationExtractor( |
| 297 | attr.fields(C).x.converter.__call__ |
| 298 | ).get_return_type() |
| 299 | ) |
| 300 | |
| 301 | |
| 302 | class TestOptionalPipe: |
nothing calls this directly
no test coverage detected