Skip to content

Commit d0acbdd

Browse files
committed
Error on specific warnings
This also skips the RedirectsPanel's deprecation warning from raising errors.
1 parent 7382193 commit d0acbdd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Pending
1616
``debug_toolbar.store.DatabaseStore`` with ``SKIP_TOOLBAR_QUERIES``.
1717
* Fixed font family for code blocks and stack traces in the toolbar.
1818
* Added test to confirm Django's ``TestCase.assertNumQueries`` works.
19+
* Updated tox configuration to treat ``DeprecationWarning``,
20+
``ResourceWarning``, and ``PendingDeprecationWarning`` as errors.
1921

2022
6.1.0 (2025-10-30)
2123
------------------

tox.ini

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,19 @@ passenv=
4343
GITHUB_*
4444
setenv =
4545
PYTHONPATH = {toxinidir}
46-
PYTHONWARNINGS = d
46+
PYTHONWARNINGS =\
47+
error::ResourceWarning,\
48+
error::DeprecationWarning,\
49+
error::PendingDeprecationWarning,\
50+
ignore:The RedirectsPanel is deprecated:DeprecationWarning
4751
DB_NAME = {env:DB_NAME:debug_toolbar}
4852
DB_USER = {env:DB_USER:debug_toolbar}
4953
DB_HOST = {env:DB_HOST:localhost}
5054
DB_PASSWORD = {env:DB_PASSWORD:debug_toolbar}
5155
DJANGO_SETTINGS_MODULE = tests.settings
5256
allowlist_externals = make
5357
pip_pre = True
54-
commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests}
58+
commands = python -b -m coverage run -m django test -v2 {posargs:tests}
5559

5660

5761
[testenv:py{310,311,312,313,314}-dj{42,51,52,60,main}-{postgresql,psycopg3}]

0 commit comments

Comments
 (0)