Improve output when failing an assertWarnings().

Review Request #14699 — Created Nov. 18, 2025 and updated

Information

Djblets
release-5.x

Reviewers

Previously, when assertWarnings() found fewer or more warnings than
expected, the only result we'd get was an assertion error showing the
mismatched lengths.

Now, any mismatches between expected and actual warnings will result in
a full list of the mismatches, helping with diagnosing which warnings
were missing or added.

Unit tests pass.

Tested this with an assertion error I hit. Verified I got a more useful
warnings display.

Summary ID
Improve output when failing an assertWarnings().
Previously, when `assertWarnings()` found fewer or more warnings than expected, the only result we'd get was an assertion error showing the mismatched lengths. Now, any mismatches between expected and actual warnings will result in a full list of the mismatches, helping with diagnosing which warnings were missing or added.
933fa19b5a8193d9d7d6fb3f7ae219700e3f06cf
Description From Last Updated

'django.template.base.Parser' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'collections.abc.Iterable' imported but unused Column: 5 Error code: F401

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
Review request changed
Change Summary:

Removed imports not part of this change.

Commits:
Summary ID
Improve output when failing an assertWarnings().
Previously, when `assertWarnings()` found fewer or more warnings than expected, the only result we'd get was an assertion error showing the mismatched lengths. Now, any mismatches between expected and actual warnings will result in a full list of the mismatches, helping with diagnosing which warnings were missing or added.
65e712b18a629c629a3ede06347fcdc64fb354c5
Improve output when failing an assertWarnings().
Previously, when `assertWarnings()` found fewer or more warnings than expected, the only result we'd get was an assertion error showing the mismatched lengths. Now, any mismatches between expected and actual warnings will result in a full list of the mismatches, helping with diagnosing which warnings were missing or added.
933fa19b5a8193d9d7d6fb3f7ae219700e3f06cf

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2.