Skip to content

Add warning assertion helpers - #1108

Merged
MatthewMckee4 merged 2 commits into
mainfrom
codex/issue-955
Aug 1, 2026
Merged

Add warning assertion helpers#1108
MatthewMckee4 merged 2 commits into
mainfrom
codex/issue-955

Conversation

@MatthewMckee4

Copy link
Copy Markdown
Owner

Summary

Add typed karva.warns and karva.deprecated_call context managers with regex matching, nested warning handling, filter restoration, and recorded warning access. Document their pytest-compatible use. Closes #955.

Test Plan

Ran just test -p karva fixture_support, built the docs, and ran uvx prek run -a.

@MatthewMckee4 MatthewMckee4 added the pytest Related to the support of pytest label Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

❌ Merging this PR may alter performance

Baseline: main (ce8ff7d). Candidate: PR (ecccfd9). Each benchmark compares median CLI wall time on one GitHub Actions runner, alternating install order. Runs warm the duration cache before measuring and include default per-test status output. Lower is better.

1 improved benchmark
2 regressed benchmarks
11 unchanged benchmarks

Warning

Benchmark regressions were detected. Review the wall-time changes before merging.

Performance Changes

Mode Benchmark Base Head Change Runs
WallTime h11 398.8 ms 408.5 ms +2.4% 21
WallTime installer 286.2 ms 295.3 ms +3.2% 21
WallTime tomlkit 541.1 ms 523.7 ms -3.2% 15
All benchmark scores
Mode Benchmark Base Head Change Runs
WallTime requests 16.051 s 16.061 s +0.1% 4
WallTime fastapi 6.187 s 6.196 s +0.1% 7
WallTime httpx 7.540 s 7.542 s +0.0% 7
WallTime h11 398.8 ms 408.5 ms +2.4% 21
WallTime markupsafe 253.4 ms 253.4 ms +0.0% 21
WallTime sniffio 268.3 ms 269.1 ms +0.3% 21
WallTime itsdangerous 255.7 ms 256.0 ms +0.1% 21
WallTime blinker 284.9 ms 285.5 ms +0.2% 21
WallTime jinja 574.5 ms 574.3 ms -0.0% 21
WallTime installer 286.2 ms 295.3 ms +3.2% 21
WallTime tomlkit 541.1 ms 523.7 ms -3.2% 15
WallTime outcome 269.8 ms 270.3 ms +0.2% 21
WallTime pluggy 348.1 ms 348.2 ms +0.0% 21
WallTime werkzeug 8.677 s 8.640 s -0.4% 7

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

✅ Merging this PR will not alter memory usage

All benchmark scores
Mode Benchmark Base Head Change Runs
Memory requests 60.2 MiB 60.1 MiB -0.0% 4
Memory fastapi 146.0 MiB 146.5 MiB +0.3% 7
Memory httpx 81.0 MiB 81.0 MiB +0.0% 7
Memory h11 53.1 MiB 53.1 MiB +0.1% 21
Memory markupsafe 41.9 MiB 41.9 MiB -0.1% 21
Memory sniffio 47.5 MiB 47.6 MiB +0.2% 21
Memory itsdangerous 44.1 MiB 44.2 MiB +0.1% 21
Memory blinker 46.9 MiB 46.9 MiB +0.0% 21
Memory jinja 56.9 MiB 56.9 MiB -0.1% 21
Memory installer 48.7 MiB 48.8 MiB +0.1% 21
Memory tomlkit 49.0 MiB 49.1 MiB +0.1% 15
Memory outcome 48.5 MiB 48.6 MiB +0.1% 21
Memory pluggy 45.9 MiB 45.9 MiB +0.1% 21
Memory werkzeug 136.3 MiB 135.8 MiB -0.4% 7

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

✅ No diagnostic changes

Test result comparison
Project Previous New
requests ❌ 149 pass · 0 fail · 6 error · 12 skip ❌ 149 pass · 0 fail · 6 error · 12 skip
fastapi ❌ 1596 pass · 7 fail · 434 error · 1 skip ❌ 1596 pass · 7 fail · 434 error · 1 skip
httpx ❌ 1022 pass · 50 fail · 54 error · 1 skip ❌ 1022 pass · 50 fail · 54 error · 1 skip
h11 ✅ 78 pass · 0 fail · 0 error · 0 skip ✅ 78 pass · 0 fail · 0 error · 0 skip
markupsafe ❌ 0 pass · 0 fail · 26 error · 0 skip ❌ 0 pass · 0 fail · 26 error · 0 skip
sniffio ✅ 3 pass · 0 fail · 0 error · 1 skip ✅ 3 pass · 0 fail · 0 error · 1 skip
itsdangerous ✅ 10 pass · 0 fail · 0 error · 0 skip ✅ 10 pass · 0 fail · 0 error · 0 skip
blinker ✅ 25 pass · 0 fail · 0 error · 0 skip ✅ 25 pass · 0 fail · 0 error · 0 skip
jinja ❌ 135 pass · 0 fail · 16 error · 0 skip ❌ 135 pass · 0 fail · 16 error · 0 skip
installer ✅ 20 pass · 0 fail · 0 error · 0 skip ✅ 20 pass · 0 fail · 0 error · 0 skip
tomlkit ✅ 332 pass · 0 fail · 0 error · 0 skip ✅ 332 pass · 0 fail · 0 error · 0 skip
outcome ✅ 10 pass · 0 fail · 0 error · 0 skip ✅ 10 pass · 0 fail · 0 error · 0 skip
pluggy ❌ 124 pass · 1 fail · 27 error · 0 skip ❌ 124 pass · 1 fail · 27 error · 0 skip
werkzeug ❌ 728 pass · 3 fail · 0 error · 0 skip ❌ 728 pass · 3 fail · 0 error · 0 skip

@MatthewMckee4 MatthewMckee4 added extensions/functions Related to built-in Karva functions and removed pytest Related to the support of pytest labels Aug 1, 2026
@MatthewMckee4
MatthewMckee4 merged commit afbcc98 into main Aug 1, 2026
31 checks passed
@MatthewMckee4
MatthewMckee4 deleted the codex/issue-955 branch August 1, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions/functions Related to built-in Karva functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add warning assertion helpers

1 participant