Skip to content

Commit 5f0abe3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ethanhs/silencenodes
2 parents 3332c99 + 3329bbb commit 5f0abe3

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

changelog/378.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix support for gevent monkeypatching

changelog/384.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for pytest 4.1.

testing/acceptance_test.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,15 @@ def pytest_sessionfinish(session):
541541
assert collected_file.read() == "collected = 3"
542542

543543

544-
def test_funcarg_teardown_failure(testdir):
544+
def test_fixture_teardown_failure(testdir):
545545
p = testdir.makepyfile(
546546
"""
547547
import pytest
548-
@pytest.fixture
548+
@pytest.fixture(scope="module")
549549
def myarg(request):
550-
def teardown(val):
551-
raise ValueError(val)
552-
return request.cached_setup(setup=lambda: 42, teardown=teardown,
553-
scope="module")
550+
yield 42
551+
raise ValueError(42)
552+
554553
def test_hello(myarg):
555554
pass
556555
"""
@@ -636,6 +635,11 @@ def test_crash():
636635

637636

638637
def test_issue34_pluginloading_in_subprocess(testdir):
638+
import _pytest.hookspec
639+
640+
if not hasattr(_pytest.hookspec, "pytest_namespace"):
641+
pytest.skip("this pytest version no longer supports pytest_namespace()")
642+
639643
testdir.tmpdir.join("plugin123.py").write(
640644
textwrap.dedent(
641645
"""

xdist/looponfail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def pytest_cmdline_main(config):
3232
if config.getoption("looponfail"):
3333
usepdb = config.getoption("usepdb") # a core option
3434
if usepdb:
35-
raise pytest.UsageError("--pdb incompatible with --looponfail.")
35+
raise pytest.UsageError("--pdb is incompatible with --looponfail.")
3636
looponfail_main(config)
3737
return 2 # looponfail only can get stop with ctrl-C anyway
3838

xdist/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ def pytest_addoption(parser):
126126
)
127127
parser.addini(
128128
"rsyncdirs",
129-
"list of (relative) paths to be rsynced for" " remote distributed testing.",
129+
"list of (relative) paths to be rsynced for remote distributed testing.",
130130
type="pathlist",
131131
)
132132
parser.addini(
133133
"rsyncignore",
134-
"list of (relative) glob-style paths to be ignored " "for rsyncing.",
134+
"list of (relative) glob-style paths to be ignored for rsyncing.",
135135
type="pathlist",
136136
)
137137
parser.addini(

xdist/scheduler/loadscope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def remove_node(self, node):
187187
break
188188
else:
189189
raise RuntimeError(
190-
"Unable to identify crashitem on a workload with " "pending items"
190+
"Unable to identify crashitem on a workload with pending items"
191191
)
192192

193193
# Made uncompleted work unit available again

xdist/workermanage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def shutdown(self):
268268
if not self._down:
269269
try:
270270
self.sendcommand("shutdown")
271-
except IOError:
271+
except (IOError, OSError):
272272
pass
273273
self._shutdown_sent = True
274274

@@ -345,7 +345,11 @@ def process_from_remote(self, eventcall): # noqa too complex
345345
except: # noqa
346346
from _pytest._code import ExceptionInfo
347347

348-
excinfo = ExceptionInfo()
348+
# ExceptionInfo API changed in pytest 4.1
349+
if hasattr(ExceptionInfo, "from_current"):
350+
excinfo = ExceptionInfo.from_current()
351+
else:
352+
excinfo = ExceptionInfo()
349353
print("!" * 20, excinfo)
350354
self.config.notify_exception(excinfo)
351355
self.shutdown()

0 commit comments

Comments
 (0)