From: Daniele Varrazzo Date: Sat, 2 Dec 2023 01:56:35 +0000 (+0100) Subject: test: skip some tests that raise an error on pypy 3.9 X-Git-Tag: 3.1.14~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=602c875f7156e74f2b923a3fb4c2e9aa476ba6cf;p=thirdparty%2Fpsycopg.git test: skip some tests that raise an error on pypy 3.9 The error is: anyio/_backends/_asyncio.py:2039: in _cancel_all_tasks raise cast(BaseException, task.exception()) ... > result = coro.throw(exc) E RuntimeError: can't do async_generator.athrow().throw() The error only happens on Pypy 3.9, and doesn't happen on master, only in the maint 3.1 branch. 3.1 uses anyio < 4, master uses anyio >= 4, so I would say that the error is limited to only this combination and that it is an anyio bug. The problem affects just two tests, so let's just skip them. Whatever. --- diff --git a/tests/test_connection_async.py b/tests/test_connection_async.py index 17ecbe3d6..b71d58bcc 100644 --- a/tests/test_connection_async.py +++ b/tests/test_connection_async.py @@ -1,3 +1,4 @@ +import sys import time import pytest import logging @@ -18,6 +19,11 @@ from .test_conninfo import fake_resolve # noqa: F401 pytestmark = pytest.mark.anyio +anyio_3_runtime_error = pytest.mark.skipif( + sys.version_info < (3, 10) and sys.implementation.name == "pypy", + reason="anyio 3 runtime error", +) + async def test_connect(aconn_cls, dsn): conn = await aconn_cls.connect(dsn) @@ -125,6 +131,7 @@ async def test_cursor_closed(aconn): aconn.cursor() +@anyio_3_runtime_error async def test_connection_warn_close(aconn_cls, dsn, recwarn, gc_collect): conn = await aconn_cls.connect(dsn) await conn.close() @@ -233,6 +240,7 @@ async def test_context_active_rollback_no_clobber(aconn_cls, dsn, caplog): @pytest.mark.slow +@anyio_3_runtime_error async def test_weakref(aconn_cls, dsn, gc_collect): conn = await aconn_cls.connect(dsn) w = weakref.ref(conn)