If the wrapped validator doesn't fail, not_ should fail.
(self)
| 1178 | v(1, a, input_value) |
| 1179 | |
| 1180 | def test_fails_because_success(self): |
| 1181 | """ |
| 1182 | If the wrapped validator doesn't fail, not_ should fail. |
| 1183 | """ |
| 1184 | |
| 1185 | def always_passes(inst, attr, value): |
| 1186 | pass |
| 1187 | |
| 1188 | v = not_(always_passes) |
| 1189 | a = simple_attr("test") |
| 1190 | input_value = 3 |
| 1191 | |
| 1192 | with pytest.raises(ValueError) as e: |
| 1193 | v(1, a, input_value) |
| 1194 | |
| 1195 | assert ( |
| 1196 | ( |
| 1197 | f"not_ validator child '{always_passes!r}' did not raise a captured error" |
| 1198 | ), |
| 1199 | a, |
| 1200 | always_passes, |
| 1201 | input_value, |
| 1202 | self.DEFAULT_EXC_TYPES, |
| 1203 | ) == e.value.args |
| 1204 | |
| 1205 | def test_composable_with_in_pass(self): |
| 1206 | """ |
nothing calls this directly
no test coverage detected