Modify parse_raw() and parse_file() not to emit spurious warnings
Modify the `parse_raw()` and `parse_file()` to ignore deprecation
warnings from their implementation details. The methods themselves
are deprecated, and that should be the only deprecation warning
interesting to the user. This also fixes test failures with pytest-8
that no longer ignores warnings that did not match `pytest.warns()`.
1497490
2 months ago by mgorny
0%
Fix test_json_schema double warning failure with pytest-8
Add a warning filter to test_json_schema to resolve the test failure
with pytest-8. The test currently uses parametrization to assert for
a single call emitting two separate warnings, since `pytest.warns()`
used to consume all non-matched warnings before. However, with pytest-8
it reemits the remaining warnings and therefore causes test to fail
due to the `error` filter. When pydantic requires pytest >= 8, we can
instead switch to using two `pytest.warns()`.