MCPcopy
hub / github.com/psycopg/psycopg / test_notify_timeout_0

Function test_notify_timeout_0

tests/test_notify_async.py:136–148  ·  view source on GitHub ↗
(aconn_cls, aconn, dsn)

Source from the content-addressed store, hash-verified

134@pytest.mark.slow
135@pytest.mark.timing
136async def test_notify_timeout_0(aconn_cls, aconn, dsn):
137 await aconn.set_autocommit(True)
138 await aconn.execute("listen foo")
139
140 ns = await alist(aconn.notifies(timeout=0))
141 assert not ns
142
143 async with await aconn_cls.connect(dsn, autocommit=True) as nconn:
144 await nconn.execute("notify foo, '1'")
145 await asleep(0.1)
146
147 ns = await alist(aconn.notifies(timeout=0))
148 assert len(ns) == 1
149
150
151@pytest.mark.slow

Callers

nothing calls this directly

Calls 6

alistFunction · 0.85
asleepFunction · 0.70
set_autocommitMethod · 0.45
executeMethod · 0.45
notifiesMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected