From: Daniele Varrazzo Date: Wed, 7 May 2025 10:43:23 +0000 (+0200) Subject: fix(test): work around error with issubclass(collections.ablc.Callable) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad0289373af3c0d3d868ea8e6fc409762b547a9b;p=thirdparty%2Fpsycopg.git fix(test): work around error with issubclass(collections.ablc.Callable) Reproduced only on Python 3.10 --- 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)