Skip to content

Commit a4c8a7d

Browse files
use forwards and backwards compatible annotation check
1 parent 5588631 commit a4c8a7d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

unittests/test_functools_lru.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33

44
import pytest
5+
from typing_extensions import get_annotations, Format
56

67
import asyncstdlib as a
78

@@ -175,5 +176,5 @@ async def other_method(self):
175176
if name != "method":
176177
continue
177178
# test direct and literal annotation styles
178-
assert Bar.method.__annotations__["int_arg"] in {int, "int"}
179-
assert Bar().method.__annotations__["int_arg"] in {int, "int"}
179+
assert get_annotations(Bar.method, format=Format.STRING)['int_arg'] == "int"
180+
assert get_annotations(Bar().method, format=Format.STRING)['int_arg'] == "int"

0 commit comments

Comments
 (0)