summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2023-03-07 18:21:48 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2023-03-07 21:48:38 +0000
commit529efe7bc944202f19fec1f406958f1485e4056a (patch)
tree4a56ea11bd84380e2cd0595f90faef5d1d3cc48c
parent7fd2e7450b8b9bc4e9a5b04ea43b558bedd03517 (diff)
downloadpython-setuptools-git-529efe7bc944202f19fec1f406958f1485e4056a.tar.gz
Enforce deprecation warnings in setuptools test suite
-rw-r--r--setuptools/tests/test_warnings.py3
-rw-r--r--tox.ini1
2 files changed, 3 insertions, 1 deletions
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