Skip to content

Commit 62e2100

Browse files
committed
Add readme note for async_callbacks
1 parent f2cacf6 commit 62e2100

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ functions, which take funcargs, does not work. Please use
6161
res = yield threads.deferToThread(os.listdir, tmpdir.strpath)
6262
assert res == []
6363

64+
65+
async_callbacks
66+
=================
67+
Using `twisted.internet.defer.ensureDeferred` as a decorator for test
68+
functions, which take funcargs, does not work. Please use
69+
`pytest_twisted.async_callbacks` instead::
70+
71+
@pytest_twisted.async_callbacks
72+
async def test_some_stuff(tmpdir):
73+
res = await threads.deferToThread(os.listdir, tmpdir.strpath)
74+
assert res == []
75+
76+
6477
Waiting for deferreds in fixtures
6578
=================================
6679
`pytest_twisted.blockon` allows fixtures to wait for deferreds::

0 commit comments

Comments
 (0)