Skip to content

Commit 37b922a

Browse files
committed
test: suppress an ast deprecation 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 a nd will be removed in Python 3.14; use ast.Constant instead expl_format = self.pop_format_context(ast.Str(expl)) ```
1 parent 5925d8a commit 37b922a

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ filterwarnings = [
4040
"ignore:the imp module is deprecated in favour of importlib:DeprecationWarning",
4141
"ignore:distutils Version classes are deprecated:DeprecationWarning",
4242
"ignore:The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning",
43-
"ignore:is deprecated and will be removed in Python 3.14; use ast.Constant instead:DeprecationWarning",
4443
]
4544

4645
# xfail tests that pass should fail the test suite

tests/conftest.py

-7
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ def set_warnings() -> None:
5454
message=r"module 'sre_constants' is deprecated",
5555
)
5656

57-
# From _pytest/assertion/rewrite.py
58-
warnings.filterwarnings(
59-
"ignore",
60-
category=DeprecationWarning,
61-
message=r"is deprecated and will be removed in Python 3.14; use ast.Constant instead",
62-
)
63-
6457
warnings.filterwarnings(
6558
"ignore",
6659
category=pytest.PytestRemovedIn8Warning,

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ setenv =
3030
# For some tests, we need .pyc files written in the current directory,
3131
# so override any local setting.
3232
PYTHONPYCACHEPREFIX=
33+
PYTHONWARNINGS=ignore:removed in Python 3.14; use ast.Constant:DeprecationWarning
3334

3435
# $set_env.py: COVERAGE_PIP_ARGS - Extra arguments for `pip install`
3536
# `--no-build-isolation` will let tox work with no network.

0 commit comments

Comments
 (0)