Raise ValueError if the value is outside our options when the options are specified as a string and the value is not a string.
(self)
| 431 | ) == e.value.args |
| 432 | |
| 433 | def test_fail_with_string(self): |
| 434 | """ |
| 435 | Raise ValueError if the value is outside our options when the |
| 436 | options are specified as a string and the value is not a string. |
| 437 | """ |
| 438 | v = in_("abc") |
| 439 | a = simple_attr("test") |
| 440 | with pytest.raises(ValueError) as e: |
| 441 | v(None, a, None) |
| 442 | assert ( |
| 443 | "'test' must be in 'abc' (got None)", |
| 444 | a, |
| 445 | "abc", |
| 446 | None, |
| 447 | ) == e.value.args |
| 448 | |
| 449 | def test_repr(self): |
| 450 | """ |
nothing calls this directly
no test coverage detected