Skip to content

Commit

Permalink
Fixed deprecation warning about @no_type_check_decorator on Python …
Browse files Browse the repository at this point in the history
…3.13

Fixes #414.
  • Loading branch information
agronholm committed Mar 24, 2024
1 parent 286f86d commit a0f4594
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", pypy-3.10]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -98,7 +98,7 @@ pretty = true
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = pypy3, py38, py39, py310, py311, py312
envlist = pypy3, py38, py39, py310, py311, py312, py313
skip_missing_interpreters = true
minversion = 4.0
Expand Down
21 changes: 11 additions & 10 deletions tests/dummymodule.py
Expand Up @@ -40,9 +40,17 @@
P = ParamSpec("P")


@no_type_check_decorator
def dummy_decorator(func):
return func
if sys.version_info <= (3, 13):

@no_type_check_decorator
def dummy_decorator(func):
return func

@dummy_decorator
def non_type_checked_decorated_func(x: int, y: str) -> 6:
# This is to ensure that we avoid using a local variable that's already in use
_call_memo = "foo" # noqa: F841
return "foo"


@typechecked
Expand All @@ -55,13 +63,6 @@ def non_type_checked_func(x: int, y: str) -> 6:
return "foo"


@dummy_decorator
def non_type_checked_decorated_func(x: int, y: str) -> 6:
# This is to ensure that we avoid using a local variable that's already in use
_call_memo = "foo" # noqa: F841
return "foo"


@typeguard_ignore
def non_typeguard_checked_func(x: int, y: str) -> 6:
return "foo"
Expand Down

0 comments on commit a0f4594

Please sign in to comment.