()
| 672 | |
| 673 | |
| 674 | def test_json(): |
| 675 | m = SimpleModel(x=1) |
| 676 | with pytest.warns( |
| 677 | PydanticDeprecatedSince20, match=r'^The `json` method is deprecated; use `model_dump_json` instead\.' |
| 678 | ): |
| 679 | assert m.json() == '{"x":1}' |
| 680 | |
| 681 | with pytest.warns(PydanticDeprecatedSince20): |
| 682 | with pytest.raises(TypeError, match='The `encoder` argument is no longer supported'): |
| 683 | m.json(encoder=1) |
| 684 | with pytest.raises(TypeError, match='The `models_as_dict` argument is no longer supported'): |
| 685 | m.json(models_as_dict=True) |
| 686 | with pytest.raises(TypeError, match='`dumps_kwargs` keyword arguments are no longer supported.'): |
| 687 | m.json(foo=4) |
| 688 | |
| 689 | |
| 690 | def test_parse_obj(): |
nothing calls this directly
no test coverage detected