Raise ValueError if the value is outside our options.
(self)
| 414 | v(1, a, 3) |
| 415 | |
| 416 | def test_fail(self): |
| 417 | class="st">""" |
| 418 | Raise ValueError if the value is outside our options. |
| 419 | class="st">""" |
| 420 | v = in_([1, 2, 3]) |
| 421 | a = simple_attr(class="st">"test") |
| 422 | |
| 423 | with pytest.raises(ValueError) as e: |
| 424 | v(None, a, None) |
| 425 | |
| 426 | assert ( |
| 427 | class="st">"&class="cm">#x27;test' must be in [1, 2, 3] (got None)", |
| 428 | a, |
| 429 | [1, 2, 3], |
| 430 | None, |
| 431 | ) == e.value.args |
| 432 | |
| 433 | def test_fail_with_string(self): |
| 434 | class="st">""" |
nothing calls this directly
no test coverage detected