(py_and_json: PyAndJson)
| 6 | |
| 7 | |
| 8 | def test_after(py_and_json: PyAndJson): |
| 9 | def f(input_value, info): |
| 10 | return input_value + f'| context: {info.context}' |
| 11 | |
| 12 | v = py_and_json(core_schema.with_info_after_validator_function(f, core_schema.str_schema())) |
| 13 | |
| 14 | assert v.validate_test('foobar') == 'foobar| context: None' |
| 15 | assert v.validate_test('foobar', None, {1: 10}) == 'foobar| context: {1: 10}' |
| 16 | assert v.validate_test('foobar', None, 'frogspawn') == 'foobar| context: frogspawn' |
| 17 | |
| 18 | |
| 19 | def test_mutable_context(py_and_json: PyAndJson): |
nothing calls this directly
no test coverage detected