summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-05-11 06:13:17 -0400
committerNed Batchelder <ned@nedbatchelder.com>2023-05-11 06:13:17 -0400
commitee17e7cdf5cae88b8807970581a995469e37e034 (patch)
treeaa206ff259bc35222a4a0d755e71fde78d2784dd
parentf2a9648bb14b5cbb56274ca3a20a6024d117efd1 (diff)
downloadpython-coveragepy-git-ee17e7cdf5cae88b8807970581a995469e37e034.tar.gz
test: try to silence a new warning
For example: ``` .tox/anypy/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:1004: 50 warnings /Users/nedbatchelder/coverage/trunk/.tox/anypy/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:1004: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead expl_format = self.pop_format_context(ast.Str(expl)) ```
-rw-r--r--pyproject.toml1
-rw-r--r--tests/conftest.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/pyproject.toml b/pyproject.toml
index cf9c2c0e..d14ca17f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -40,6 +40,7 @@ filterwarnings = [
"ignore:the imp module is deprecated in favour of importlib:DeprecationWarning",
"ignore:distutils Version classes are deprecated:DeprecationWarning",
"ignore:The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning",
+ "ignore:is deprecated and will be removed in Python 3.14; use ast.Constant instead:DeprecationWarning",
]
# xfail tests that pass should fail the test suite
diff --git a/tests/conftest.py b/tests/conftest.py
index 41db85b4..6d3ec318 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -40,7 +40,7 @@ def set_warnings() -> None:
warnings.simplefilter("once", DeprecationWarning)
# Warnings to suppress:
- # How come these warnings are successfully suppressed here, but not in setup.cfg??
+ # How come these warnings are successfully suppressed here, but not in pyproject.toml??
warnings.filterwarnings(
"ignore",
@@ -54,6 +54,13 @@ def set_warnings() -> None:
message=r"module 'sre_constants' is deprecated",
)
+ # From _pytest/assertion/rewrite.py
+ warnings.filterwarnings(
+ "ignore",
+ category=DeprecationWarning,
+ message=r"is deprecated and will be removed in Python 3.14; use ast.Constant instead",
+ )
+
warnings.filterwarnings(
"ignore",
category=pytest.PytestRemovedIn8Warning,