Skip to content

Commit 2dc67d3

Browse files
committed
Update readme
1 parent 22ed6c7 commit 2dc67d3

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

CONTRIBUTING.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
What it takes to add a new reactor:
2+
-----------------------------------
3+
4+
* In ``pytest_twisted.py``
5+
6+
* Write an ``init_foo_reactor()`` function
7+
* Add ``'foo': init_foo_reactor,`` to ``_reactor_fixtures`` where the key will be the string to be passed such as ``--reactor=foo``.
8+
9+
* In ``testing/test_basic.py``
10+
11+
* Add ``test_blockon_in_hook_with_foo()`` decorated by ``@skip_if_reactor_not('foo')``
12+
* Add ``test_wrong_reactor_with_foo()`` decorated by ``@skip_if_reactor_not('foo')``
13+
14+
* In ``tox.ini``
15+
16+
* Adjust ``envlist`` to include the ``fooreactor`` factor for the appropriate versions of Python
17+
* Add conditional ``deps`` for the new reactor such as ``foo: foobar`` to the appropriate test environments
18+
* Add the conditional assignment ``foo: reactor_option=foo`` to ``setenv`` in the appropriate test environments
19+
20+
* In ``.travis.yml``
21+
22+
* Consider any extra system packages which may be required

README.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pytest-twisted - test twisted code with pytest
66

77
|Travis|_ |AppVeyor|_ |Pythons|
88

9-
:Authors: Ralf Schmitt, Victor Titor
9+
:Authors: Ralf Schmitt, Kyle Altendorf, Victor Titor
1010
:Version: 1.6
1111
:Date: 2018-01-12
1212
:Download: https://pypi.python.org/pypi/pytest-twisted#downloads
@@ -33,13 +33,18 @@ The plugin is available after installation and can be disabled using
3333
By default ``twisted.internet.default`` is used to install the reactor.
3434
This creates the same reactor that ``import twisted.internet.reactor``
3535
would. Alternative reactors can be specified using the ``--reactor``
36-
option. Presently only ``qt5reactor`` is supported for use with
37-
``pyqt5`` and ``pytest-qt``.
36+
option.
37+
38+
Presently only ``qt5reactor`` is supported for use with ``pyqt5``
39+
and ``pytest-qt``. This `guide`_ describes how to add support for
40+
a new reactor.
3841

3942
The reactor is automatically created prior to the first test but can
4043
be explicitly installed earlier by calling
4144
``pytest_twisted.init_default_reactor()`` or the corresponding function
42-
for the desired alternate reactor. Beware that in situations such as
45+
for the desired alternate reactor.
46+
47+
Beware that in situations such as
4348
a ``conftest.py`` file that the name ``pytest_twisted`` may be
4449
undesirably detected by ``pytest`` as an unknown hook. One alternative
4550
is to ``import pytest_twisted as pt``.
@@ -93,3 +98,5 @@ That's all.
9398

9499
.. |Pythons| image:: https://img.shields.io/pypi/pyversions/pytest-twisted.svg
95100
:alt: supported Python versions
101+
102+
.. _guide: CONTRIBUTING.rst

0 commit comments

Comments
 (0)