Skip to content

Commit 295b86f

Browse files
authored
Merge pull request #51 from daa/fix-double-pytest-configure
Fix double definition of pytest_configure
2 parents 54bb3b1 + 261d145 commit 295b86f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pytest_twisted.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ class _instances:
2222
reactor = None
2323

2424

25-
def pytest_configure():
26-
pytest.inlineCallbacks = inlineCallbacks
27-
pytest.blockon = blockon
28-
29-
3025
def blockon(d):
3126
if _config.external_reactor:
3227
return block_from_thread(d)
@@ -185,4 +180,6 @@ def pytest_addoption(parser):
185180

186181

187182
def pytest_configure(config):
183+
pytest.inlineCallbacks = inlineCallbacks
184+
pytest.blockon = blockon
188185
reactor_installers[config.getoption("reactor")]()

testing/test_basic.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ def cmd_opts(request):
4141
return ("--reactor={}".format(reactor),)
4242

4343

44+
def test_inline_callbacks_in_pytest():
45+
assert hasattr(pytest, 'inlineCallbacks')
46+
47+
48+
def test_blockon_in_pytest():
49+
assert hasattr(pytest, 'blockon')
50+
51+
4452
def test_fail_later(testdir, cmd_opts):
4553
test_file = """
4654
from twisted.internet import reactor, defer

0 commit comments

Comments
 (0)