From 529efe7bc944202f19fec1f406958f1485e4056a Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Tue, 7 Mar 2023 18:21:48 +0000 Subject: Enforce deprecation warnings in setuptools test suite --- setuptools/tests/test_warnings.py | 3 ++- tox.ini | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/setuptools/tests/test_warnings.py b/setuptools/tests/test_warnings.py index 75e468d2..013e2526 100644 --- a/setuptools/tests/test_warnings.py +++ b/setuptools/tests/test_warnings.py @@ -60,7 +60,7 @@ _EXAMPLES = { @pytest.mark.parametrize("example_name", _EXAMPLES.keys()) -def test_formatting(example_name): +def test_formatting(monkeypatch, example_name): """ It should automatically handle indentation, interpolation and things like due date. """ @@ -68,6 +68,7 @@ def test_formatting(example_name): kwargs = _EXAMPLES[example_name]["kwargs"] expected = _EXAMPLES[example_name]["expected"] + monkeypatch.setenv("SETUPTOOLS_ENFORCE_DEPRECATION", "false") with pytest.warns(SetuptoolsWarning) as warn_info: SetuptoolsWarning.emit(*args, **kwargs) assert _get_message(warn_info) == cleandoc(expected) diff --git a/tox.ini b/tox.ini index 2bae6728..2ad4f2fb 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ deps = # Ideally all the dependencies should be set as "extras" setenv = PYTHONWARNDEFAULTENCODING = 1 + SETUPTOOLS_ENFORCE_DEPRECATION = 1 commands = pytest {posargs} usedevelop = True -- cgit v1.2.1