(py_and_json: PyAndJson)
| 52 | |
| 53 | |
| 54 | def test_wrap(py_and_json: PyAndJson): |
| 55 | def f(input_value, validator, info): |
| 56 | return validator(input_value) + f'| context: {info.context}' |
| 57 | |
| 58 | v = py_and_json(core_schema.with_info_wrap_validator_function(f, core_schema.str_schema())) |
| 59 | |
| 60 | assert v.validate_test('foobar') == 'foobar| context: None' |
| 61 | assert v.validate_test('foobar', None, {1: 10}) == 'foobar| context: {1: 10}' |
| 62 | assert v.validate_test('foobar', None, 'frogspawn') == 'foobar| context: frogspawn' |
| 63 | |
| 64 | |
| 65 | def test_isinstance(py_and_json: PyAndJson): |
nothing calls this directly
no test coverage detected