summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2022-09-03 13:42:45 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2022-09-03 21:34:40 +0300
commit02dd92a159b9ce99fe725949ab955d02f9450a75 (patch)
treefaf39e3efb939786d88832de89ea9b0e4515c50b /tests
parent38e257e4b30f6affadebf60b6c7a0ee0282d9fe3 (diff)
downloadapscheduler-02dd92a159b9ce99fe725949ab955d02f9450a75.tar.gz
Improved the asyncpg event broker
* It now recovers from a server disconnection * Replaced from_asyncpg_pool() with from_dsn() * Only copy the connection options from the async engine in from_async_sqla_engine()
Diffstat (limited to 'tests')
-rw-r--r--tests/test_eventbrokers.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/test_eventbrokers.py b/tests/test_eventbrokers.py
index 451b848..09942f5 100644
--- a/tests/test_eventbrokers.py
+++ b/tests/test_eventbrokers.py
@@ -61,14 +61,12 @@ def mqtt_broker(serializer: Serializer) -> EventBroker:
@pytest.fixture
async def asyncpg_broker(serializer: Serializer) -> AsyncEventBroker:
- from asyncpg import create_pool
-
from apscheduler.eventbrokers.asyncpg import AsyncpgEventBroker
- pool = await create_pool("postgres://postgres:secret@localhost:5432/testdb")
- broker = AsyncpgEventBroker.from_asyncpg_pool(pool, serializer=serializer)
+ broker = AsyncpgEventBroker.from_dsn(
+ "postgres://postgres:secret@localhost:5432/testdb", serializer=serializer
+ )
yield broker
- await pool.close()
@pytest.fixture(