From 433324956abb028f6d993195d31e4dd8308115c3 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Mon, 20 Mar 2023 22:32:03 +0800 Subject: [PATCH] Fix tests for typeguard 3.x (#394) typeguard 3.x introduced an incompatible change to `check_type()`'s signature. Co-authored-by: Julien Danjou --- .../Fix-tests-for-typeguard-3.x-6eebfea546b6207e.yaml | 3 +++ tests/test_tenacity.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/Fix-tests-for-typeguard-3.x-6eebfea546b6207e.yaml diff --git a/releasenotes/notes/Fix-tests-for-typeguard-3.x-6eebfea546b6207e.yaml b/releasenotes/notes/Fix-tests-for-typeguard-3.x-6eebfea546b6207e.yaml new file mode 100644 index 00000000..9688c3d4 --- /dev/null +++ b/releasenotes/notes/Fix-tests-for-typeguard-3.x-6eebfea546b6207e.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - "Fixes test failures with typeguard 3.x" diff --git a/tests/test_tenacity.py b/tests/test_tenacity.py index 82806a69..b646e23c 100644 --- a/tests/test_tenacity.py +++ b/tests/test_tenacity.py @@ -1542,10 +1542,10 @@ def num_to_str(number): with_constructor_result = with_raw(1) # These raise TypeError exceptions if they fail - check_type("with_raw", with_raw, typing.Callable[[int], str]) - check_type("with_raw_result", with_raw_result, str) - check_type("with_constructor", with_constructor, typing.Callable[[int], str]) - check_type("with_constructor_result", with_constructor_result, str) + check_type(with_raw, typing.Callable[[int], str]) + check_type(with_raw_result, str) + check_type(with_constructor, typing.Callable[[int], str]) + check_type(with_constructor_result, str) @contextmanager