From: Daniele Varrazzo Date: Wed, 15 Dec 2021 00:24:28 +0000 (+0100) Subject: Reuse fixture across test module X-Git-Tag: pool-3.1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=262a7f851d0309e41da4aa3f3c5752e730c45fec;p=thirdparty%2Fpsycopg.git Reuse fixture across test module The fixture is duplicated. Funnily enough, the dupe in async is less efficient than the one in the sync test module, but it allowed to spot the bug at the previous commit, after using it more than the prepared threshold. Ungratefully dropping it. --- diff --git a/tests/test_cursor_async.py b/tests/test_cursor_async.py index dd9009b49..9a73f8456 100644 --- a/tests/test_cursor_async.py +++ b/tests/test_cursor_async.py @@ -10,7 +10,9 @@ from psycopg.adapt import PyFormat from .utils import gc_collect from .test_cursor import my_row_factory +from .test_cursor import execmany, _execmany # noqa: F401 +execmany = execmany # avoid F811 underneath pytestmark = pytest.mark.asyncio @@ -233,17 +235,6 @@ async def test_query_badenc(aconn): await cur.execute("select '\u20ac'") -@pytest.fixture(scope="function") -async def execmany(svcconn): - cur = svcconn.cursor() - cur.execute( - """ - drop table if exists execmany; - create table execmany (id serial primary key, num integer, data text) - """ - ) - - async def test_executemany(aconn, execmany): cur = aconn.cursor() await cur.executemany(