From ad0289373af3c0d3d868ea8e6fc409762b547a9b Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 7 May 2025 12:43:23 +0200 Subject: [PATCH] fix(test): work around error with issubclass(collections.ablc.Callable) Reproduced only on Python 3.10 --- tests/test_adapt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_adapt.py b/tests/test_adapt.py index 764375715..f80b0aacc 100644 --- a/tests/test_adapt.py +++ b/tests/test_adapt.py @@ -448,7 +448,12 @@ def test_optimised_adapters(): for n1 in dir(mod): if not isinstance((obj := getattr(mod, n1)), type): continue - if not issubclass(obj, (Dumper, Loader)): + try: + if not issubclass(obj, (Dumper, Loader)): + continue + except TypeError: + # On Python 3.10 'collections.abc.Callable' raises: + # TypeError: issubclass() arg 1 must be a class continue c_adapters.pop(obj.__name__, None) -- 2.47.2