Skip to content

Commit 2754809

Browse files
authored
Add explanation of --reactor to README.rst
1 parent e7dcb32 commit 2754809

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ Using the plugin
2929
The plugin is available after installation and can be disabled using
3030
``-p no:twisted``.
3131

32+
By default ``twisted.internet.default`` is used to install the reactor.
33+
This creates the same reactor that ``import twisted.internet.reactor``
34+
would. Alternative reactors can be specified using the ``--reactor``
35+
option. Presently only ``qt5reactor`` is supported for use with
36+
``pyqt5`` and ``pytest-qt``.
37+
38+
The reactor is automatically created prior to the first test but can
39+
be explicitly installed earlier by calling
40+
``pytest_twisted.init_default_reactor()`` or the corresponding function
41+
for the desired alternate reactor. Beware that in situations such as
42+
a ``conftest.py`` file that the name ``pytest_twisted`` may be
43+
undesirably detected by ``pytest`` as an unknown hook. One alternative
44+
is to ``import pytest_twisted as pt``.
45+
3246

3347
inlineCallbacks
3448
=================

0 commit comments

Comments
 (0)