Commit 34fe781a authored by Scott Talbert's avatar Scott Talbert

New upstream version 1.22.0

parent 45ca7bbf
sudo: false
language: python
python:
- '2.6'
- '2.7'
- '3.4'
- '3.5'
- '3.6'
install: pip install tox-travis setuptools_scm
matrix:
include:
# note: please use "tox --listenvs" to populate the build matrix
- python: "3.5"
env: TOXENV=flakes
- python: "3.5"
env: TOXENV=readme
script: tox
notifications:
irc:
channels:
- chat.freenode.net#pytest
- 'chat.freenode.net#pytest'
on_success: change
on_failure: change
skip_join: true
email:
- pytest-commit@python.org
deploy:
python:
- '2.7'
- '3.4'
- '3.5'
- '3.6'
env:
- TOXENV=py-pytest30
- TOXENV=py-pytest31
- TOXENV=py-pytest32
- TOXENV=py-pytest33
install: pip install tox setuptools_scm
script: tox
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"
env: TOXENV=readme
- stage: deploy
python: '3.6'
env:
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
pytest-xdist 1.22.0 (2018-01-11)
================================
Features
--------
- Add support for the ``pytest_runtest_logfinish`` hook which will be released
in pytest 3.4. (`#266
<https://github.com/pytest-dev/pytest-xdist/issues/266>`_)
pytest-xdist 1.21.0 (2017-12-22)
================================
Deprecations and Removals
-------------------------
- Drop support for EOL Python 2.6. (`#259
<https://github.com/pytest-dev/pytest-xdist/issues/259>`_)
Features
--------
- New ``--dist=loadfile`` option which load-distributes test to workers grouped
by the file the tests live in. (`#242
<https://github.com/pytest-dev/pytest-xdist/issues/242>`_)
Bug Fixes
---------
- Fix accidental mutation of test report during serialization causing longrepr
string-ification to break. (`#241
<https://github.com/pytest-dev/pytest-xdist/issues/241>`_)
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)
================================
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://pypi.python.org/pypi/flaky>`_. (`#206 <https://github.com/pytest-
dev/pytest-xdist/issues/206>`_)
Bug Fixes
---------
- Fix issue where tests were being incorrectly identified if a worker crashed
during the ``teardown`` stage of the test. (`#124 <https://github.com/pytest-
dev/pytest-xdist/issues/124>`_)
pytest-xdist 1.19.1 (2017-08-10)
================================
Bug Fixes
---------
- Fix crash when transferring internal pytest warnings from workers to the
master node. (`#214 <https://github.com/pytest-dev/pytest-
xdist/issues/214>`_)
pytest-xdist 1.19.0 (2017-08-09)
================================
Deprecations and Removals
-------------------------
- ``--boxed`` functionality has been moved to a separate plugin, `pytest-forked
<https://github.com/pytest-dev/pytest-forked>`_. This release now depends on
`` pytest-forked`` and provides ``--boxed`` as a backward compatibility
option. (`#1 <https://github.com/pytest-dev/pytest-xdist/issues/1>`_)
Features
--------
- New ``--dist=loadscope`` option: sends group of related tests to the same
worker. Tests are grouped by module for test functions and by class for test
methods. See ``README.rst`` for more information. (`#191 <https://github.com
/pytest-dev/pytest-xdist/issues/191>`_)
- Warnings are now properly transferred from workers to the master node. (`#92
<https://github.com/pytest-dev/pytest-xdist/issues/92>`_)
Bug Fixes
---------
- Fix serialization of native tracebacks (``--tb=native``). (`#196
<https://github.com/pytest-dev/pytest-xdist/issues/196>`_)
pytest-xdist 1.18.2 (2017-07-28)
================================
......@@ -187,7 +301,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
......
Metadata-Version: 1.1
Metadata-Version: 1.2
Name: pytest-xdist
Version: 1.18.2
Version: 1.22.0
Summary: py.test xdist plugin for distributed testing and loop-on-failing modes
Home-page: https://github.com/pytest-dev/pytest-xdist
Author: holger krekel and contributors
Author-email: pytest-dev@python.org,holger@merlinux.eu
License: MIT
Description-Content-Type: UNKNOWN
Description:
.. image:: http://img.shields.io/pypi/v/pytest-xdist.svg
:alt: PyPI version
:target: https://pypi.python.org/pypi/pytest-xdist
.. image:: https://img.shields.io/pypi/pyversions/pytest-xdist.svg
:alt: Python versions
:target: https://pypi.python.org/pypi/pytest-xdist
.. image:: https://anaconda.org/conda-forge/pytest-xdist/badges/version.svg
:alt: Anaconda version
:target: https://anaconda.org/conda-forge/pytest-xdist
.. image:: https://travis-ci.org/pytest-dev/pytest-xdist.svg?branch=master
:alt: Travis CI build status
:target: https://travis-ci.org/pytest-dev/pytest-xdist
.. image:: https://ci.appveyor.com/api/projects/status/56eq1a1avd4sdd7e/branch/master?svg=true
:alt: AppVeyor build status
:target: https://ci.appveyor.com/project/pytestbot/pytest-xdist
xdist: pytest distributed testing plugin
......@@ -30,8 +39,6 @@ Description:
those for a combined test run. This allows to speed up
development or to use special resources of `remote machines`_.
* ``--boxed``: (not available on Windows) run each test in a boxed_
subprocess to survive ``SEGFAULTS`` or otherwise dying processes
* ``--looponfail``: run your tests repeatedly in a subprocess. After each run
py.test waits until a file in your project changes and then re-runs
......@@ -46,6 +53,9 @@ Description:
are reported back and displayed to your local terminal.
You may specify different Python versions and interpreters.
If you would like to know how pytest-xdist works under the covers, checkout
`OVERVIEW <https://github.com/pytest-dev/pytest-xdist/blob/master/OVERVIEW.md>`_.
Installation
-----------------------
......@@ -196,6 +206,7 @@ Description:
Identifying the worker process during a test
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.15.*
If you need to determine the identity of a worker process in
a test or fixture, you may use the ``worker_id`` fixture to do so:
......@@ -221,8 +232,6 @@ Description:
well, under worker_id attribute.
*New in version 1.15.*
Specifying test exec environments in an ini file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -240,7 +249,7 @@ Description:
.. code-block:: ini
[pytest]
addopts = --tx ssh=myhost//python=python2.5 --tx ssh=myhost//python=python2.6
addopts = --tx ssh=myhost//python=python2.5 --tx ssh=myhost//python=python3.6
and then just type::
......@@ -248,6 +257,99 @@ Description:
to run tests in each of the environments.
Sending groups of related tests to the same worker
++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.19.*
.. note::
This is an **experimental** feature: the actual functionality will
likely stay the same, but the CLI might change slightly in future versions.
You can send groups of related tests to the same worker by using the
``--dist=loadscope`` option. Tests will be grouped by **module**
for *test functions* and by **class** for *test methods*.
For example, consider this two test files:
.. code-block:: python
# content of test_container.py
import pytest
def test_container_startup():
pass
def test_container_logging():
pass
@pytest.mark.parametrize('methods', ['ssh', 'http'])
def test_container_communication(methods):
pass
# content of test_io.py
class TestHDF:
def test_listing(self):
pass
def test_search(self):
pass
class TestXML:
def test_listing(self):
pass
def test_search(self):
pass
By executing ``pytest -v --dist=loadscope -n4`` you might get this output
(sorted by worker for readability)::
============================= test session starts =============================
<skip header>
gw0 [8] / gw1 [8] / gw2 [8] / gw3 [8]
scheduling tests via LoadScopeScheduling
[gw0] PASSED test_container.py::test_container_communication[http]
[gw0] PASSED test_container.py::test_container_communication[ssh]
[gw0] PASSED test_container.py::test_container_logging
[gw0] PASSED test_container.py::test_container_startup
[gw1] PASSED test_io.py::TestHDF::test_listing
[gw1] PASSED test_io.py::TestHDF::test_search
[gw2] PASSED test_io.py::TestXML::test_listing
[gw2] PASSED test_io.py::TestXML::test_search
========================== 8 passed in 0.56 seconds ===========================
As you can see, all test functions from ``test_container.py`` executed on
the same worker ``gw0``, while the test methods from classes ``TestHDF`` and
``TestXML`` executed in workers ``gw1`` and ``gw2`` respectively.
Currently the groupings can't be customized, with grouping by class takes
priority over grouping by module.
Sending tests to the same worker based on their file
++++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.21.*
.. note::
This is an **experimental** feature: the actual functionality will
likely stay the same, but the CLI might change slightly in future versions.
You can send tests to the same worker grouped by their filename by using the
``--dist=loadfile`` option, so tests of the same file are guaranteed to run
in the same worker.
Using the example in the previous section, all tests from ``test_container.py`` will
run in the same worker, as well as the tests in ``test_io.py``.
Specifying "rsync" dirs in an ini-file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -281,4 +383,10 @@ Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
.. image:: http://img.shields.io/pypi/v/pytest-xdist.svg
:alt: PyPI version
:target: https://pypi.python.org/pypi/pytest-xdist
.. image:: https://img.shields.io/pypi/pyversions/pytest-xdist.svg
:alt: Python versions
:target: https://pypi.python.org/pypi/pytest-xdist
.. image:: https://anaconda.org/conda-forge/pytest-xdist/badges/version.svg
:alt: Anaconda version
:target: https://anaconda.org/conda-forge/pytest-xdist
.. image:: https://travis-ci.org/pytest-dev/pytest-xdist.svg?branch=master
:alt: Travis CI build status
:target: https://travis-ci.org/pytest-dev/pytest-xdist
.. image:: https://ci.appveyor.com/api/projects/status/56eq1a1avd4sdd7e/branch/master?svg=true
:alt: AppVeyor build status
:target: https://ci.appveyor.com/project/pytestbot/pytest-xdist
xdist: pytest distributed testing plugin
......@@ -22,8 +30,6 @@ test execution modes:
those for a combined test run. This allows to speed up
development or to use special resources of `remote machines`_.
* ``--boxed``: (not available on Windows) run each test in a boxed_
subprocess to survive ``SEGFAULTS`` or otherwise dying processes
* ``--looponfail``: run your tests repeatedly in a subprocess. After each run
py.test waits until a file in your project changes and then re-runs
......@@ -38,6 +44,9 @@ program source code to the remote place. All test results
are reported back and displayed to your local terminal.
You may specify different Python versions and interpreters.
If you would like to know how pytest-xdist works under the covers, checkout
`OVERVIEW <https://github.com/pytest-dev/pytest-xdist/blob/master/OVERVIEW.md>`_.
Installation
-----------------------
......@@ -188,6 +197,7 @@ at once. The specifications strings use the `xspec syntax`_.
Identifying the worker process during a test
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.15.*
If you need to determine the identity of a worker process in
a test or fixture, you may use the ``worker_id`` fixture to do so:
......@@ -213,8 +223,6 @@ The information about the worker_id in a test is stored in the TestReport as
well, under worker_id attribute.
*New in version 1.15.*
Specifying test exec environments in an ini file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -232,7 +240,7 @@ You can also add default environments like this:
.. code-block:: ini
[pytest]
addopts = --tx ssh=myhost//python=python2.5 --tx ssh=myhost//python=python2.6
addopts = --tx ssh=myhost//python=python2.5 --tx ssh=myhost//python=python3.6
and then just type::
......@@ -240,6 +248,99 @@ and then just type::
to run tests in each of the environments.
Sending groups of related tests to the same worker
++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.19.*
.. note::
This is an **experimental** feature: the actual functionality will
likely stay the same, but the CLI might change slightly in future versions.
You can send groups of related tests to the same worker by using the
``--dist=loadscope`` option. Tests will be grouped by **module**
for *test functions* and by **class** for *test methods*.
For example, consider this two test files:
.. code-block:: python
# content of test_container.py
import pytest
def test_container_startup():
pass
def test_container_logging():
pass
@pytest.mark.parametrize('methods', ['ssh', 'http'])
def test_container_communication(methods):
pass
# content of test_io.py
class TestHDF:
def test_listing(self):
pass
def test_search(self):
pass
class TestXML:
def test_listing(self):
pass
def test_search(self):
pass
By executing ``pytest -v --dist=loadscope -n4`` you might get this output
(sorted by worker for readability)::
============================= test session starts =============================
<skip header>
gw0 [8] / gw1 [8] / gw2 [8] / gw3 [8]
scheduling tests via LoadScopeScheduling
[gw0] PASSED test_container.py::test_container_communication[http]
[gw0] PASSED test_container.py::test_container_communication[ssh]
[gw0] PASSED test_container.py::test_container_logging
[gw0] PASSED test_container.py::test_container_startup
[gw1] PASSED test_io.py::TestHDF::test_listing
[gw1] PASSED test_io.py::TestHDF::test_search
[gw2] PASSED test_io.py::TestXML::test_listing
[gw2] PASSED test_io.py::TestXML::test_search
========================== 8 passed in 0.56 seconds ===========================
As you can see, all test functions from ``test_container.py`` executed on
the same worker ``gw0``, while the test methods from classes ``TestHDF`` and
``TestXML`` executed in workers ``gw1`` and ``gw2`` respectively.
Currently the groupings can't be customized, with grouping by class takes
priority over grouping by module.
Sending tests to the same worker based on their file
++++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.21.*
.. note::
This is an **experimental** feature: the actual functionality will
likely stay the same, but the CLI might change slightly in future versions.
You can send tests to the same worker grouped by their filename by using the
``--dist=loadfile`` option, so tests of the same file are guaranteed to run
in the same worker.
Using the example in the previous section, all tests from ``test_container.py`` will
run in the same worker, as well as the tests in ``test_io.py``.
Specifying "rsync" dirs in an ini-file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
environment:
matrix:
# note: please use "tox --listenvs" to populate the build matrix
- TOXENV: "py26-pytest30"
- TOXENV: "py27-pytest30"
- TOXENV: "py34-pytest30"
- TOXENV: "py35-pytest30"
- TOXENV: "py36-pytest30"
- TOXENV: "py27-pytest30-pexpect"
- TOXENV: "py35-pytest30-pexpect"
- TOXENV: "py27-pytest33"
- TOXENV: "py34-pytest33"
- TOXENV: "py35-pytest33"
- TOXENV: "py36-pytest33"
- TOXENV: "py27-pytest33-pexpect"
- TOXENV: "py36-pytest33-pexpect"
- TOXENV: "flakes"
- TOXENV: "readme"
install:
- C:\Python35\python -m pip install tox setuptools_scm
- C:\Python35\python -m pip install -U tox setuptools_scm pip
build: false # Not a C# project, build stuff at the test step instead.
......
.. note::
Since 1.19.0, the actual implementation of the ``--boxed`` option has been moved to a
separate plugin, `pytest-forked <https://github.com/pytest-dev/pytest-forked>`_
which can be installed independently. The ``--boxed`` command-line options remains
for backward compatibility reasons.
If your testing involves C or C++ libraries you might have to deal
......@@ -19,7 +25,7 @@ to run each test in a controlled subprocess. Here is a basic example::
If you run this with::
$ py.test --boxed
$ py.test -n1
=========================== test session starts ============================
platform linux2 -- Python 2.7.3 -- pytest-2.3.0.dev8
plugins: xdist, bugzilla, cache, oejskit, cli, pep8, cov
......@@ -40,7 +46,7 @@ You'll see that a couple of tests are reported as crashing, indicated
by lower-case ``f`` and the respective failure summary. You can also use
the xdist-provided parallelization feature to speed up your testing::
$ py.test --boxed -n3
$ py.test -n3
=========================== test session starts ============================
platform linux2 -- Python 2.7.3 -- pytest-2.3.0.dev8
plugins: xdist, bugzilla, cache, oejskit, cli, pep8, cov
......
def epsilon1(arg1, arg2=1000):
"""Do epsilon1
Usage:
>>> epsilon1(10, 20)
40
>>> epsilon1(30)
1040
"""
return arg1 + arg2 + 10
def epsilon2(arg1, arg2=1000):
"""Do epsilon2
Usage:
>>> epsilon2(10, 20)
-20
>>> epsilon2(30)
-980
"""
return arg1 - arg2 - 10
def epsilon3(arg1, arg2=1000):
"""Do epsilon3
Usage:
>>> epsilon3(10, 20)
200
>>> epsilon3(30)
30000
"""
return arg1 * arg2
from time import sleep
def test_alpha0():
sleep(5)
assert True
def test_alpha1():
sleep(5)
assert True
def test_alpha2():
sleep(5)
assert True
def test_alpha3():
sleep(5)
assert True
def test_alpha4():
sleep(5)
assert True
def test_alpha5():
sleep(5)
assert True
def test_alpha6():
sleep(5)
assert True
def test_alpha7():
sleep(5)
assert True
def test_alpha8():
sleep(5)
assert True
def test_alpha9():
sleep(5)
assert True
from time import sleep
def test_beta0():
sleep(5)
assert True
def test_beta1():
sleep(5)
assert True
def test_beta2():
sleep(5)
assert True
def test_beta3():
sleep(5)
assert True
def test_beta4():
sleep(5)
assert True
def test_beta5():
sleep(5)
assert True
def test_beta6():
sleep(5)
assert True
def test_beta7():
sleep(5)
assert True
def test_beta8():
sleep(5)
assert True
def test_beta9():
sleep(5)
assert True
from time import sleep
from unittest import TestCase
class Delta1(TestCase):
def test_delta0(self):
sleep(5)
assert True
def test_delta1(self):
sleep(5)
assert True
def test_delta2(self):
sleep(5)
assert True
def test_delta3(self):