2024-01-28 21:12:42 +08:00
|
|
|
# mypy: allow-untyped-defs
|
2020-09-20 02:56:52 +08:00
|
|
|
import pytest_twisted
|
|
|
|
from twisted.internet.task import deferLater
|
|
|
|
|
|
|
|
|
|
|
|
def sleep():
|
|
|
|
import twisted.internet.reactor
|
|
|
|
|
|
|
|
return deferLater(clock=twisted.internet.reactor, delay=0)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest_twisted.inlineCallbacks
|
|
|
|
def test_inlineCallbacks():
|
|
|
|
yield sleep()
|
|
|
|
|
|
|
|
|
|
|
|
@pytest_twisted.ensureDeferred
|
|
|
|
async def test_inlineCallbacks_async():
|
|
|
|
await sleep()
|