Skip to content

Commit 4e03290

Browse files
authored
Merge pull request #70 from pytest-dev/readme_rst_tidy
Tidy readme rst-wise
2 parents 4c9ccd1 + 2efe352 commit 4e03290

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

README.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ considered.
3232

3333

3434
Installation
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

4446
The plugin is available after installation and can be disabled using
4547
``-p no:twisted``.
@@ -66,7 +68,9 @@ inlineCallbacks
6668
===============
6769
Using ``twisted.internet.defer.inlineCallbacks`` as a decorator for test
6870
functions, 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
==============
7983
Using ``twisted.internet.defer.ensureDeferred`` as a decorator for test
8084
functions, 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
103111
pytest 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
118128
Some libraries (e.g. corotwine) need to know the greenlet, which is
119129
running 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

Comments
 (0)