Returned validator has a useful `__repr__`.
(self, validator)
| 369 | ) == e.value.args |
| 370 | |
| 371 | def test_repr(self, validator): |
| 372 | """ |
| 373 | Returned validator has a useful `__repr__`. |
| 374 | """ |
| 375 | v = optional(validator) |
| 376 | |
| 377 | if isinstance(validator, list): |
| 378 | repr_s = ( |
| 379 | f"<optional validator for _AndValidator(_validators=[{always_pass!r}, " |
| 380 | "<instance_of validator for type <class 'int'>>]) or None>" |
| 381 | ) |
| 382 | elif isinstance(validator, tuple): |
| 383 | repr_s = ( |
| 384 | f"<optional validator for _AndValidator(_validators=({always_pass!r}, " |
| 385 | "<instance_of validator for type <class 'int'>>)) or None>" |
| 386 | ) |
| 387 | else: |
| 388 | repr_s = ( |
| 389 | "<optional validator for <instance_of validator for type " |
| 390 | "<class 'int'>> or None>" |
| 391 | ) |
| 392 | |
| 393 | assert repr_s == repr(v) |
| 394 | |
| 395 | |
| 396 | class TestIn_: |
nothing calls this directly
no test coverage detected