]> git.ipfire.org Git - thirdparty/psycopg.git/commit
test: use Windows asyncio policy in "non-asyncio" pool tests 507/head
authorDenis Laxalde <denis.laxalde@dalibo.com>
Sun, 5 Feb 2023 17:40:16 +0000 (18:40 +0100)
committerDenis Laxalde <denis.laxalde@dalibo.com>
Sun, 5 Feb 2023 17:48:05 +0000 (18:48 +0100)
commit65a477ee4a9c17bfb4166bcbb3fe83dc73fc4d03
treeed0884a9058b1cf5909366f9e43c64677ce6bfe9
parentb6cc8343159fc0a27365e09a3beef06433f3f1b5
test: use Windows asyncio policy in "non-asyncio" pool tests

In commit b6cc8343159fc0a27365e09a3beef06433f3f1b5, we drop the global
asyncio.set_event_loop_policy() for Windows in conftest.py, replacing it
with asyncio_options to be used by the anyio test runner. However, test
cases in test_pool_async_noasyncio.py are not "async def" so they would
not use that anyio runner (nor did they use pytest-asyncio's runner
before); but they need the event loop policy for Windows still.
Accordingly, we configure the loop from "anyio_backend_options" in
asyncio_run() fixture.
tests/pool/test_pool_async_noasyncio.py