Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adaa10f285 | ||
|
|
1cd7001647 | ||
|
|
95b660e26a | ||
|
|
7a5efcdb76 | ||
|
|
9e59d07947 | ||
|
|
3799caa4fc | ||
|
|
1e66af6389 | ||
|
|
7674f6b186 | ||
|
|
c83f73e19c | ||
|
|
c874872190 | ||
|
|
e4f36b18f3 | ||
|
|
0cdef59428 | ||
|
|
4bb06e3f74 | ||
|
|
2c9b0b8894 | ||
|
|
b464335c83 | ||
|
|
24b478446a | ||
|
|
d4d52dc933 | ||
|
|
e5c2347934 |
12
.travis.yml
12
.travis.yml
@@ -29,6 +29,14 @@ jobs:
|
||||
include:
|
||||
- stage: test
|
||||
# python x env above are already included into this stage
|
||||
- python: "2.7"
|
||||
env: TOXENV=py27-pytestmaster
|
||||
- python: "2.7"
|
||||
env: TOXENV=py27-pytestfeatures
|
||||
- python: "3.6"
|
||||
env: TOXENV=py36-pytestmaster
|
||||
- python: "3.6"
|
||||
env: TOXENV=py36-pytestfeatures
|
||||
- python: "3.6"
|
||||
env: TOXENV=flakes
|
||||
- python: "3.6"
|
||||
@@ -37,15 +45,15 @@ jobs:
|
||||
- stage: deploy
|
||||
python: '3.6'
|
||||
env:
|
||||
install: skip
|
||||
install: pip install -U setuptools setuptools_scm
|
||||
script: skip
|
||||
deploy:
|
||||
provider: pypi
|
||||
user: ronny
|
||||
distributions: sdist bdist_wheel
|
||||
skip_upload_docs: true
|
||||
password:
|
||||
secure: cxmSDho5d+PYKEM4ZCg8ms1P4lzhYkrw6fEOm2HtTcsuCyY6aZMSgImWAnEYbJHSkdzgcxlXK9UKJ9B0YenXmBCkAr7UjdnpNXNmkySr0sYzlH/sfqt/dDATCHFaRKxnkOSOVywaDYhT9n8YudbXI77pXwD12i/CeSSJDbHhsu0JYUfAcb+D6YjRYoA2SEGCnzSzg+gDDfwXZx4ZiODCGLVwieNp1klCg88YROUE1BaYYNuUOONvfXX8+TWowbCF6ChH1WL/bZ49OStEYQNuYxZQZr4yClIqu9VJbchrU8j860K9ott2kkGTgfB/dDrQB/XncBubyIX9ikzCQAmmBXWAI3eyvWLPDk2Jz7kW2l2RT7syct80tCq3JhvQ1qdwr5ap7siocTLgnBW0tF4tkHSTFN3510fkc43npnp6FThebESQpnI24vqpwJ9hI/kW5mYi014Og2E/cpCXnz2XO8iZPDbqAMQpDsqEQoyhfGNgPTGp4K30TxRtwZBI5hHhDKnnR16fXtRgt1gYPvz/peUQvvpOm4JzIzGXPzluuutpnCBy75v5+oiwT3YRrLL/Meims9FtDDXL3qQubAE/ezIOOpm0N5XXV8DxIom8EN71yq5ab1tqhM+tBX7owRjy4FR4If2Q8feBdmTuh26DIQt/y+qSG8VkB9Sw/JCjc7c=
|
||||
on:
|
||||
tags: true
|
||||
distributions: sdist bdist_wheel
|
||||
repo: pytest-dev/pytest-xdist
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
pytest-xdist 1.20.1 (2017-10-05)
|
||||
================================
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- Fix hang when all worker nodes crash and restart limit is reached (`#45
|
||||
<https://github.com/pytest-dev/pytest-xdist/issues/45>`_)
|
||||
|
||||
- Fix issue where the -n option would still run distributed tests when pytest
|
||||
was run with the --collect-only option (`#5
|
||||
<https://github.com/pytest-dev/pytest-xdist/issues/5>`_)
|
||||
|
||||
|
||||
pytest-xdist 1.20.0 (2017-08-17)
|
||||
================================
|
||||
|
||||
@@ -6,7 +20,7 @@ Features
|
||||
|
||||
- ``xdist`` now supports tests to log results multiple times, improving
|
||||
integration with plugins which require it like `pytest-rerunfailures
|
||||
<https://github.com/gocept/pytest-rerunfailures>_` and `flaky
|
||||
<https://github.com/gocept/pytest-rerunfailures>`_ and `flaky
|
||||
<https://pypi.python.org/pypi/flaky>`_. (`#206 <https://github.com/pytest-
|
||||
dev/pytest-xdist/issues/206>`_)
|
||||
|
||||
@@ -250,7 +264,7 @@ Improved Documentation
|
||||
in master. Thanks Aron Curzon.
|
||||
|
||||
- fix pytest issue419 by sending/receiving indices into the test
|
||||
collection instead of node ids (which are not neccessarily unique
|
||||
collection instead of node ids (which are not necessarily unique
|
||||
for functions parametrized with duplicate values)
|
||||
|
||||
- send multiple "to test" indices in one network message to a slave
|
||||
|
||||
@@ -262,6 +262,17 @@ class TestDistribution:
|
||||
child.close()
|
||||
# assert ret == 2
|
||||
|
||||
def test_dist_with_collectonly(self, testdir):
|
||||
p1 = testdir.makepyfile("""
|
||||
def test_ok():
|
||||
pass
|
||||
""")
|
||||
result = testdir.runpytest(p1, "-n1", "--collect-only")
|
||||
assert result.ret == 0
|
||||
result.stdout.fnmatch_lines([
|
||||
"*collected 1 item*",
|
||||
])
|
||||
|
||||
|
||||
class TestDistEach:
|
||||
def test_simple(self, testdir):
|
||||
@@ -701,6 +712,17 @@ class TestNodeFailure:
|
||||
"*2 failed*2 passed*",
|
||||
])
|
||||
|
||||
def test_max_slave_restart_die(self, testdir):
|
||||
f = testdir.makepyfile("""
|
||||
import os
|
||||
os._exit(1)
|
||||
""")
|
||||
res = testdir.runpytest(f, '-n4', '--max-slave-restart=0')
|
||||
res.stdout.fnmatch_lines([
|
||||
"*Unexpectedly no active workers*",
|
||||
"*INTERNALERROR*"
|
||||
])
|
||||
|
||||
def test_disable_restart(self, testdir):
|
||||
f = testdir.makepyfile("""
|
||||
import os
|
||||
|
||||
@@ -44,6 +44,36 @@ def test_auto_detect_cpus(testdir, monkeypatch):
|
||||
assert config.getoption('numprocesses') == 99
|
||||
|
||||
|
||||
def test_boxed_with_collect_only(testdir):
|
||||
from xdist.plugin import pytest_cmdline_main as check_options
|
||||
config = testdir.parseconfigure("-n1", "--boxed")
|
||||
check_options(config)
|
||||
assert config.option.forked
|
||||
|
||||
config = testdir.parseconfigure("-n1", "--collect-only")
|
||||
check_options(config)
|
||||
assert not config.option.forked
|
||||
|
||||
config = testdir.parseconfigure("-n1", "--boxed", "--collect-only")
|
||||
check_options(config)
|
||||
assert config.option.forked
|
||||
|
||||
|
||||
def test_dsession_with_collect_only(testdir):
|
||||
from xdist.plugin import pytest_cmdline_main as check_options
|
||||
from xdist.plugin import pytest_configure as configure
|
||||
|
||||
config = testdir.parseconfigure("-n1")
|
||||
check_options(config)
|
||||
configure(config)
|
||||
assert config.pluginmanager.hasplugin("dsession")
|
||||
|
||||
config = testdir.parseconfigure("-n1", "--collect-only")
|
||||
check_options(config)
|
||||
configure(config)
|
||||
assert not config.pluginmanager.hasplugin("dsession")
|
||||
|
||||
|
||||
class TestDistOptions:
|
||||
def test_getxspecs(self, testdir):
|
||||
config = testdir.parseconfigure("--tx=popen", "--tx", "ssh=xyz")
|
||||
|
||||
3
tox.ini
3
tox.ini
@@ -3,6 +3,7 @@
|
||||
envlist=
|
||||
py{26,27,34,35,36}-pytest{30,31,32}
|
||||
py{27,36}-pytest{30,31,32}-pexpect
|
||||
py{27,36}-pytest{master,features}
|
||||
flakes
|
||||
readme
|
||||
|
||||
@@ -17,6 +18,8 @@ deps =
|
||||
pytest30: pytest~=3.0.5
|
||||
pytest31: pytest~=3.1.0
|
||||
pytest32: pytest~=3.2.0
|
||||
pytestmaster: git+https://github.com/pytest-dev/pytest.git@master
|
||||
pytestfeatures: git+https://github.com/pytest-dev/pytest.git@features
|
||||
pexpect: pexpect
|
||||
platform=
|
||||
pexpect: linux|darwin
|
||||
|
||||
@@ -120,6 +120,10 @@ class DSession:
|
||||
def loop_once(self):
|
||||
"""Process one callback from one of the slaves."""
|
||||
while 1:
|
||||
if not self._active_nodes:
|
||||
# If everything has died stop looping
|
||||
self.triggershutdown()
|
||||
raise RuntimeError("Unexpectedly no active workers available")
|
||||
try:
|
||||
eventcall = self.queue.get(timeout=2.0)
|
||||
break
|
||||
|
||||
@@ -91,7 +91,7 @@ def pytest_addhooks(pluginmanager):
|
||||
|
||||
@pytest.mark.trylast
|
||||
def pytest_configure(config):
|
||||
if config.getoption("dist") != "no":
|
||||
if config.getoption("dist") != "no" and not config.getvalue("collectonly"):
|
||||
from xdist.dsession import DSession
|
||||
session = DSession(config)
|
||||
config.pluginmanager.register(session, "dsession")
|
||||
@@ -115,7 +115,7 @@ def pytest_cmdline_main(config):
|
||||
if val("dist") != "no":
|
||||
if usepdb:
|
||||
raise pytest.UsageError(
|
||||
"--pdb incompatible with distributing tests.")
|
||||
"--pdb is incompatible with distributing tests; try using -n0.") # noqa: E501
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# fixtures
|
||||
|
||||
Reference in New Issue
Block a user