Skip to content

Commit

Permalink
Update class method deprecation warnings for Python 3.13
Browse files Browse the repository at this point in the history
Update the version range for modified deprecation warnings that was
introduced in efb3e60, since Python
3.13 reverted the change originally introduced in 3.9 and is back to
the old messages.  This fixes tests with Python 3.13.

See also GrahamDumpleton/wrapt#260.
  • Loading branch information
mgorny committed Jun 28, 2024
1 parent 0e8d804 commit 3b1aec9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test_classic_deprecated_class_method__warns(classic_deprecated_class_method)
assert len(warns) == 1
warn = warns[0]
assert issubclass(warn.category, DeprecationWarning)
if sys.version_info >= (3, 9):
if (3, 9) <= sys.version_info < (3, 13):
assert "deprecated class method" in str(warn.message)
else:
assert "deprecated function (or staticmethod)" in str(warn.message)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_sphinx_deprecated_class_method__warns(sphinx_deprecated_class_method):
assert len(warns) == 1
warn = warns[0]
assert issubclass(warn.category, DeprecationWarning)
if sys.version_info >= (3, 9):
if (3, 9) <= sys.version_info < (3, 13):
assert "deprecated class method" in str(warn.message)
else:
assert "deprecated function (or staticmethod)" in str(warn.message)
Expand Down

0 comments on commit 3b1aec9

Please sign in to comment.