Raises a ValueError if repr=False and str=True.
(self)
| 433 | assert (str(e) == repr(e)) is add_str |
| 434 | |
| 435 | def test_str_no_repr(self): |
| 436 | """ |
| 437 | Raises a ValueError if repr=False and str=True. |
| 438 | """ |
| 439 | with pytest.raises(ValueError) as e: |
| 440 | simple_class(repr=False, str=True) |
| 441 | |
| 442 | assert ( |
| 443 | "__str__ can only be generated if a __repr__ exists." |
| 444 | ) == e.value.args[0] |
| 445 | |
| 446 | |
| 447 | # these are for use in TestAddHash.test_cache_hash_serialization |
nothing calls this directly
no test coverage detected