@@ -32,14 +32,16 @@ considered.
3232
3333
3434Installation
35- ==================
36- Install the plugin with::
35+ ============
36+ Install the plugin as below.
37+
38+ .. code-block :: sh
3739
3840 pip install pytest-twisted
3941
4042
4143 Using the plugin
42- ==================
44+ ================
4345
4446The plugin is available after installation and can be disabled using
4547``-p no:twisted ``.
@@ -66,7 +68,9 @@ inlineCallbacks
6668===============
6769Using ``twisted.internet.defer.inlineCallbacks `` as a decorator for test
6870functions, which use fixtures, does not work. Please use
69- ``pytest_twisted.inlineCallbacks `` instead::
71+ ``pytest_twisted.inlineCallbacks `` instead.
72+
73+ .. code-block :: python
7074
7175 @pytest_twisted.inlineCallbacks
7276 def test_some_stuff (tmpdir ):
@@ -78,7 +82,9 @@ ensureDeferred
7882==============
7983Using ``twisted.internet.defer.ensureDeferred `` as a decorator for test
8084functions, which use fixtures, does not work. Please use
81- ``pytest_twisted.ensureDeferred `` instead::
85+ ``pytest_twisted.ensureDeferred `` instead.
86+
87+ .. code-block :: python
8288
8389 @pytest_twisted.ensureDeferred
8490 async def test_some_stuff (tmpdir ):
@@ -88,7 +94,9 @@ functions, which use fixtures, does not work. Please use
8894
8995 Waiting for deferreds in fixtures
9096=================================
91- ``pytest_twisted.blockon `` allows fixtures to wait for deferreds::
97+ ``pytest_twisted.blockon `` allows fixtures to wait for deferreds.
98+
99+ .. code-block :: python
92100
93101 @pytest.fixture
94102 def val ():
@@ -101,7 +109,9 @@ async/await fixtures
101109====================
102110``async ``/``await `` fixtures can be used along with ``yield `` for normal
103111pytest fixture semantics of setup, value, and teardown. At present only
104- function scope is supported::
112+ function scope is supported.
113+
114+ .. code-block :: python
105115
106116 @pytest_twisted.async_fixture
107117 async def foo ():
@@ -118,7 +128,9 @@ The twisted greenlet
118128Some libraries (e.g. corotwine) need to know the greenlet, which is
119129running the twisted reactor. It's available from the
120130``twisted_greenlet `` fixture. The following code can be used to make
121- corotwine work with pytest-twisted::
131+ corotwine work with pytest-twisted.
132+
133+ .. code-block :: python
122134
123135 @pytest.fixture (scope = " session" , autouse = True )
124136 def set_MAIN (request , twisted_greenlet ):
0 commit comments