Skip to content

Commit 213ae30

Browse files
committed
Enable mypy @deprecated decorator warnings
Currently it's not enabled by default. See: https://mypy.readthedocs.io/en/stable/changelog.html#support-for-deprecated-decorator-pep-702
1 parent e6c0d1f commit 213ae30

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ warn_unreachable = true
532532
warn_unused_configs = true
533533
no_implicit_reexport = true
534534
warn_unused_ignores = true
535+
enable_error_code = [ "deprecated" ]
535536

536537
[tool.pyright]
537538
include = [

src/_pytest/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def _force_enable_logging(
513513

514514
if isinstance(level, str):
515515
# Try to translate the level string to an int for `logging.disable()`
516-
level = logging.getLevelName(level)
516+
level = logging.getLevelName(level) # type: ignore[deprecated]
517517

518518
if not isinstance(level, int):
519519
# The level provided was not valid, so just un-disable all logging.

0 commit comments

Comments
 (0)