test_ok2/testing/plugins_integration/pytest_twisted_integration.py

19 lines
353 B
Python

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()