From 7a67fb390250d3b6dfb113634b196dbc333c05f6 Mon Sep 17 00:00:00 2001 From: EXPLOSION Date: Wed, 12 Jun 2024 09:52:53 -0400 Subject: [PATCH] Test hypothesis --- src/trio/_tests/test_exports.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/trio/_tests/test_exports.py b/src/trio/_tests/test_exports.py index b9a5d51cf..aa99111ff 100644 --- a/src/trio/_tests/test_exports.py +++ b/src/trio/_tests/test_exports.py @@ -346,6 +346,12 @@ def lookup_symbol(symbol: str) -> dict[str, str]: "__deepcopy__", } + if type(class_) == type: + # C extension classes don't have these dunders, but Python classes do + ignore_names.add("__firstlineno__") + ignore_names.add("__static_attributes__") + + # pypy seems to have some additional dunders that differ if sys.implementation.name == "pypy": ignore_names |= { @@ -401,15 +407,6 @@ def lookup_symbol(symbol: str) -> dict[str, str]: # using .remove() instead of .delete() to get an error in case they start not # being missing - if sys.version_info >= (3, 13): - try: - missing.remove("__firstlineno__") - missing.remove("__static_attributes__") - except: - print(f"FAILED: {class_}; {static_names}") - else: - print(f"SUCCESS: {class_}") - if ( tool == "jedi" and BaseException in class_.__mro__