What's the problem this feature will solve?
Currently, when tests raise 10 or more warnings in total, the warnings are aggregated to display only the filenames they come from, without test ids.
|
if len(locations) < 10: |
|
return "\n".join(map(str, locations)) |
|
|
|
counts_by_filename = Counter( |
|
str(loc).split("::", 1)[0] for loc in locations |
|
) |
|
return "\n".join( |
|
"{}: {} warning{}".format(k, v, "s" if v > 1 else "") |
|
for k, v in counts_by_filename.items() |
|
) |
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.
What's the problem this feature will solve?
Currently, when tests raise 10 or more warnings in total, the warnings are aggregated to display only the filenames they come from, without test ids.
pytest/src/_pytest/terminal.py
Lines 1126 to 1135 in 431f3e1
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.