Skip to content

Commit 2ca8f95

Browse files
committed
Improve test for annotation function as method of non-function callable
1 parent c2cccff commit 2ca8f95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_annotationlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ def __init__(inst, self, format, /, __Format=Format,
17321732
# This wouldn't happen on a normal class, but it's technically legal.
17331733
# Ensure that methods (which are special-cased) can wrap class construction
17341734
# (which is also special-cased).
1735-
custom_method = types.MethodType(Annotate, Annotate(None, Format.VALUE))
1735+
custom_method = types.MethodType(Annotate, Annotate)
17361736

17371737
annotations = annotationlib.call_annotate_function(
17381738
custom_method,
@@ -1815,7 +1815,7 @@ def test_callable_typing_generic_class_annotate_forwardref_value_fallback(self):
18151815
class Annotate[T]:
18161816
def __init__(self, format, /, __Format=Format,
18171817
__NotImplementedError=NotImplementedError):
1818-
if format == __Format.VALUE:
1818+
if format == __Format.VALUE_WITH_FAKE_GLOBALS:
18191819
self.data = {"x": int}
18201820
else:
18211821
raise __NotImplementedError(format)

0 commit comments

Comments
 (0)