Avatar for the pydantic user
pydantic
pydantic
BlogDocsChangelog

[WIP] Fixes for pytest-8 failures related to warnings

#9040Closed
Comparing
mgorny:pytest-8-warnings
(
748e90e
) with
main
(
26a2f06
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
10
New
0
Dropped
0
Ignored
0

Benchmarks

Passed

test_north_star_json_loads
tests/benchmarks/test_north_star.py::test_north_star_json_loads
CodSpeed Performance Gauge
+2%
18.5 ms
18.2 ms
test_north_star_json_dumps
tests/benchmarks/test_north_star.py::test_north_star_json_dumps
CodSpeed Performance Gauge
0%
35.8 ms
35.7 ms
test_north_star_dump_json
tests/benchmarks/test_north_star.py::test_north_star_dump_json
CodSpeed Performance Gauge
0%
39.4 ms
39.3 ms
test_north_star_validate_json
tests/benchmarks/test_north_star.py::test_north_star_validate_json
CodSpeed Performance Gauge
0%
63.3 ms
63.2 ms
test_north_star_validate_python
tests/benchmarks/test_north_star.py::test_north_star_validate_python
CodSpeed Performance Gauge
0%
36.7 ms
36.7 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_generics.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
672.3 ms
671.8 ms
test_north_star_dump_python
tests/benchmarks/test_north_star.py::test_north_star_dump_python
CodSpeed Performance Gauge
0%
15.9 ms
15.8 ms
test_north_star_validate_python_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_python_strict
CodSpeed Performance Gauge
0%
23.9 ms
24 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_simple.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
222.5 ms
223.1 ms
test_north_star_validate_json_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_json_strict
CodSpeed Performance Gauge
-3%
61.9 ms
64.1 ms

Commits

Click on a commit to change the comparison range
Base
main
26a2f06
0%
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
1 year 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()`.
748e90e
1 year ago
by mgorny
© 2025 CodSpeed Technology
Home Terms Privacy Docs