You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow disabling aggregation of warnings by filename #14983
This is counterproductive when we actually have a lot of warnings to fix in the code, because we don't know which tests / fragments of code raise them.
Describe the solution you'd like
A configuration setting to change the currently hardcoded limit (10) or disable it.
Alternative Solutions
A possible workaround is to use asserts instead of warnings.
I’d like to work on this. I plan to trace pytest’s warning aggregation and filename grouping, add a focused regression test for the configurable limit/disabled behavior, and make the smallest configuration change that preserves the current default. Please let me know if this direction fits the project.
As the issue describes, the real pain is that once you hit 10 warnings you lose the test IDs entirely - which is exactly when you need them most, since that's when you have the most warnings to track down. A minimal patch to tweak the constant doesn't help because the right threshold varies by project. The PR I am going to link makes it configurable via --warnings-collapse-threshold, keeps 10 as the default so nothing breaks and adds none to disable collapsing entirely for anyone who just wants full visibility.
Activity
seanxuu commentedon Sep 7, 2026
I’d like to work on this. I plan to trace pytest’s warning aggregation and filename grouping, add a focused regression test for the configurable limit/disabled behavior, and make the smallest configuration change that preserves the current default. Please let me know if this direction fits the project.
V1SHAL421 commentedon Sep 7, 2026
As the issue describes, the real pain is that once you hit 10 warnings you lose the test IDs entirely - which is exactly when you need them most, since that's when you have the most warnings to track down. A minimal patch to tweak the constant doesn't help because the right threshold varies by project. The PR I am going to link makes it configurable via --warnings-collapse-threshold, keeps 10 as the default so nothing breaks and adds none to disable collapsing entirely for anyone who just wants full visibility.
Add --warnings-collapse-threshold option to control warning location …
RonnyPfannschmidt commentedon Sep 21, 2026
for reference my #6833 added the initial treshold