From daba318a722cd3a6c88ca4aa14d52fbc45b90863 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 28 May 2024 21:31:01 -0700 Subject: [PATCH] Fix more tests --- Lib/test/test_dis.py | 2 +- Lib/test/test_pyclbr.py | 2 ++ Lib/test/test_pydoc/test_pydoc.py | 4 ++-- Lib/test/test_traceback.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index b0873a4f9381b7..3313a4c5370723 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -363,7 +363,7 @@ def wrap_func_w_kwargs(): CALL 1 STORE_SUBSCR - 2 LOAD_CONST 2 ( at 0x..., file "", line 2>) + 2 LOAD_CONST 2 (", line 2>) MAKE_FUNCTION STORE_NAME 3 (__annotate__) RETURN_CONST 3 (None) diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index 46206accbafc36..0c12a3085b12af 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -109,6 +109,8 @@ def ismethod(oclass, obj, name): actualMethods = [] for m in py_item.__dict__.keys(): + if m == "__annotate__": + continue if ismethod(py_item, getattr(py_item, m), m): actualMethods.append(m) foundMethods = [] diff --git a/Lib/test/test_pydoc/test_pydoc.py b/Lib/test/test_pydoc/test_pydoc.py index b4489d77d19948..afed23b3af5670 100644 --- a/Lib/test/test_pydoc/test_pydoc.py +++ b/Lib/test/test_pydoc/test_pydoc.py @@ -78,7 +78,7 @@ class A(builtins.object) class B(builtins.object) | Methods defined here: | - | __annotate__ = (...) + | __annotate__(...) | | ---------------------------------------------------------------------- | Data descriptors defined here: @@ -179,7 +179,7 @@ class A(builtins.object) class B(builtins.object) Methods defined here: - __annotate__ = (...) + __annotate__(...) ---------------------------------------------------------------------- Data descriptors defined here: __dict__ diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 3da1671b477cee..1895c88d23b70d 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -632,7 +632,7 @@ def foo(a: THIS_DOES_NOT_EXIST ) -> int: ' ~~~~~~~~^^\n' f' File "{__file__}", line {lineno_f+3}, in f_with_type\n' ' foo.__annotations__\n' - f' File "{__file__}", line {lineno_f+1}, in \n' + f' File "{__file__}", line {lineno_f+1}, in __annotate__\n' ' def foo(a: THIS_DOES_NOT_EXIST ) -> int:\n' ' ^^^^^^^^^^^^^^^^^^^\n' )