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

New upstream version 1.22.0

parent 45ca7bbf
sudo: false sudo: false
language: python 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: notifications:
irc: irc:
channels: channels:
- chat.freenode.net#pytest - 'chat.freenode.net#pytest'
on_success: change on_success: change
on_failure: change on_failure: change
skip_join: true skip_join: true
email: email:
- pytest-commit@python.org - pytest-commit@python.org
deploy:
provider: pypi python:
user: ronny - '2.7'
skip_upload_docs: true - '3.4'
password: - '3.5'
secure: cxmSDho5d+PYKEM4ZCg8ms1P4lzhYkrw6fEOm2HtTcsuCyY6aZMSgImWAnEYbJHSkdzgcxlXK9UKJ9B0YenXmBCkAr7UjdnpNXNmkySr0sYzlH/sfqt/dDATCHFaRKxnkOSOVywaDYhT9n8YudbXI77pXwD12i/CeSSJDbHhsu0JYUfAcb+D6YjRYoA2SEGCnzSzg+gDDfwXZx4ZiODCGLVwieNp1klCg88YROUE1BaYYNuUOONvfXX8+TWowbCF6ChH1WL/bZ49OStEYQNuYxZQZr4yClIqu9VJbchrU8j860K9ott2kkGTgfB/dDrQB/XncBubyIX9ikzCQAmmBXWAI3eyvWLPDk2Jz7kW2l2RT7syct80tCq3JhvQ1qdwr5ap7siocTLgnBW0tF4tkHSTFN3510fkc43npnp6FThebESQpnI24vqpwJ9hI/kW5mYi014Og2E/cpCXnz2XO8iZPDbqAMQpDsqEQoyhfGNgPTGp4K30TxRtwZBI5hHhDKnnR16fXtRgt1gYPvz/peUQvvpOm4JzIzGXPzluuutpnCBy75v5+oiwT3YRrLL/Meims9FtDDXL3qQubAE/ezIOOpm0N5XXV8DxIom8EN71yq5ab1tqhM+tBX7owRjy4FR4If2Q8feBdmTuh26DIQt/y+qSG8VkB9Sw/JCjc7c= - '3.6'
on: env:
tags: true - TOXENV=py-pytest30
distributions: sdist bdist_wheel - TOXENV=py-pytest31
repo: pytest-dev/pytest-xdist - 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
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) pytest-xdist 1.18.2 (2017-07-28)
================================ ================================
...@@ -187,7 +301,7 @@ Improved Documentation ...@@ -187,7 +301,7 @@ Improved Documentation
in master. Thanks Aron Curzon. in master. Thanks Aron Curzon.
- fix pytest issue419 by sending/receiving indices into the test - 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) for functions parametrized with duplicate values)
- send multiple "to test" indices in one network message to a slave - send multiple "to test" indices in one network message to a slave
......
Metadata-Version: 1.1 Metadata-Version: 1.2
Name: pytest-xdist Name: pytest-xdist
Version: 1.18.2 Version: 1.22.0
Summary: py.test xdist plugin for distributed testing and loop-on-failing modes Summary: py.test xdist plugin for distributed testing and loop-on-failing modes
Home-page: https://github.com/pytest-dev/pytest-xdist Home-page: https://github.com/pytest-dev/pytest-xdist
Author: holger krekel and contributors Author: holger krekel and contributors
Author-email: pytest-dev@python.org,holger@merlinux.eu Author-email: pytest-dev@python.org,holger@merlinux.eu
License: MIT License: MIT
Description-Content-Type: UNKNOWN
Description: Description:
.. image:: http://img.shields.io/pypi/v/pytest-xdist.svg .. 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 :target: https://pypi.python.org/pypi/pytest-xdist
.. image:: https://anaconda.org/conda-forge/pytest-xdist/badges/version.svg .. image:: https://anaconda.org/conda-forge/pytest-xdist/badges/version.svg
:alt: Anaconda version
:target: https://anaconda.org/conda-forge/pytest-xdist :target: https://anaconda.org/conda-forge/pytest-xdist
.. image:: https://travis-ci.org/pytest-dev/pytest-xdist.svg?branch=master .. 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 :target: https://travis-ci.org/pytest-dev/pytest-xdist
.. image:: https://ci.appveyor.com/api/projects/status/56eq1a1avd4sdd7e/branch/master?svg=true .. 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 :target: https://ci.appveyor.com/project/pytestbot/pytest-xdist
xdist: pytest distributed testing plugin xdist: pytest distributed testing plugin
...@@ -30,8 +39,6 @@ Description: ...@@ -30,8 +39,6 @@ Description:
those for a combined test run. This allows to speed up those for a combined test run. This allows to speed up
development or to use special resources of `remote machines`_. 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 * ``--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 py.test waits until a file in your project changes and then re-runs
...@@ -46,6 +53,9 @@ Description: ...@@ -46,6 +53,9 @@ Description:
are reported back and displayed to your local terminal. are reported back and displayed to your local terminal.
You may specify different Python versions and interpreters. 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 Installation
----------------------- -----------------------
...@@ -196,6 +206,7 @@ Description: ...@@ -196,6 +206,7 @@ Description:
Identifying the worker process during a test Identifying the worker process during a test
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.15.*
If you need to determine the identity of a worker process in 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: a test or fixture, you may use the ``worker_id`` fixture to do so:
...@@ -221,8 +232,6 @@ Description: ...@@ -221,8 +232,6 @@ Description:
well, under worker_id attribute. well, under worker_id attribute.
*New in version 1.15.*
Specifying test exec environments in an ini file Specifying test exec environments in an ini file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -240,7 +249,7 @@ Description: ...@@ -240,7 +249,7 @@ Description:
.. code-block:: ini .. code-block:: ini
[pytest] [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:: and then just type::
...@@ -248,6 +257,99 @@ Description: ...@@ -248,6 +257,99 @@ Description:
to run tests in each of the environments. 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 Specifying "rsync" dirs in an ini-file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -281,4 +383,10 @@ Classifier: Topic :: Software Development :: Testing ...@@ -281,4 +383,10 @@ Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Quality Assurance Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Utilities Classifier: Topic :: Utilities
Classifier: Programming Language :: Python 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
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 .. 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 :target: https://pypi.python.org/pypi/pytest-xdist
.. image:: https://anaconda.org/conda-forge/pytest-xdist/badges/version.svg .. image:: https://anaconda.org/conda-forge/pytest-xdist/badges/version.svg
:alt: Anaconda version
:target: https://anaconda.org/conda-forge/pytest-xdist :target: https://anaconda.org/conda-forge/pytest-xdist
.. image:: https://travis-ci.org/pytest-dev/pytest-xdist.svg?branch=master .. 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 :target: https://travis-ci.org/pytest-dev/pytest-xdist
.. image:: https://ci.appveyor.com/api/projects/status/56eq1a1avd4sdd7e/branch/master?svg=true .. 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 :target: https://ci.appveyor.com/project/pytestbot/pytest-xdist
xdist: pytest distributed testing plugin xdist: pytest distributed testing plugin
...@@ -22,8 +30,6 @@ test execution modes: ...@@ -22,8 +30,6 @@ test execution modes:
those for a combined test run. This allows to speed up those for a combined test run. This allows to speed up
development or to use special resources of `remote machines`_. 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 * ``--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 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 ...@@ -38,6 +44,9 @@ program source code to the remote place. All test results
are reported back and displayed to your local terminal. are reported back and displayed to your local terminal.
You may specify different Python versions and interpreters. 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 Installation
----------------------- -----------------------
...@@ -188,6 +197,7 @@ at once. The specifications strings use the `xspec syntax`_. ...@@ -188,6 +197,7 @@ at once. The specifications strings use the `xspec syntax`_.
Identifying the worker process during a test Identifying the worker process during a test
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*New in version 1.15.*
If you need to determine the identity of a worker process in 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: 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 ...@@ -213,8 +223,6 @@ The information about the worker_id in a test is stored in the TestReport as
well, under worker_id attribute. well, under worker_id attribute.
*New in version 1.15.*
Specifying test exec environments in an ini file Specifying test exec environments in an ini file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...@@ -232,7 +240,7 @@ You can also add default environments like this: ...@@ -232,7 +240,7 @@ You can also add default environments like this:
.. code-block:: ini .. code-block:: ini
[pytest] [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:: and then just type::
...@@ -240,6 +248,99 @@ and then just type:: ...@@ -240,6 +248,99 @@ and then just type::
to run tests in each of the environments. 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 Specifying "rsync" dirs in an ini-file
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
environment: environment:
matrix: matrix:
# note: please use "tox --listenvs" to populate the build matrix # note: please use "tox --listenvs" to populate the build matrix
- TOXENV: "py26-pytest30" - TOXENV: "py27-pytest33"
- TOXENV: "py27-pytest30" - TOXENV: "py34-pytest33"
- TOXENV: "py34-pytest30" - TOXENV: "py35-pytest33"
- TOXENV: "py35-pytest30" - TOXENV: "py36-pytest33"
- TOXENV: "py36-pytest30" - TOXENV: "py27-pytest33-pexpect"
- TOXENV: "py27-pytest30-pexpect" - TOXENV: "py36-pytest33-pexpect"
- TOXENV: "py35-pytest30-pexpect"
- TOXENV: "flakes" - TOXENV: "flakes"
- TOXENV: "readme" - TOXENV: "readme"
install: 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. 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 If your testing involves C or C++ libraries you might have to deal
...@@ -14,19 +20,19 @@ to run each test in a controlled subprocess. Here is a basic example:: ...@@ -14,19 +20,19 @@ to run each test in a controlled subprocess. Here is a basic example::
@pytest.mark.parametrize("arg", range(50)) @pytest.mark.parametrize("arg", range(50))
def test_func(arg): def test_func(arg):
time.sleep(0.05) # each tests takes a while time.sleep(0.05) # each tests takes a while
if arg % 19 == 0: if arg % 19 == 0:
os.kill(os.getpid(), 15) os.kill(os.getpid(), 15)
If you run this with:: If you run this with::
$ py.test --boxed $ py.test -n1
=========================== test session starts ============================ =========================== test session starts ============================
platform linux2 -- Python 2.7.3 -- pytest-2.3.0.dev8 platform linux2 -- Python 2.7.3 -- pytest-2.3.0.dev8
plugins: xdist, bugzilla, cache, oejskit, cli, pep8, cov plugins: xdist, bugzilla, cache, oejskit, cli, pep8, cov
collecting ... collected 50 items collecting ... collected 50 items
test_module.py f..................f..................f........... test_module.py f..................f..................f...........
================================= FAILURES ================================= ================================= FAILURES =================================
_______________________________ test_func[0] _______________________________ _______________________________ test_func[0] _______________________________
/home/hpk/tmp/doc-exec-420/test_module.py:6: running the test CRASHED with signal 15 /home/hpk/tmp/doc-exec-420/test_module.py:6: running the test CRASHED with signal 15
...@@ -40,13 +46,13 @@ You'll see that a couple of tests are reported as crashing, indicated ...@@ -40,13 +46,13 @@ 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 by lower-case ``f`` and the respective failure summary. You can also use
the xdist-provided parallelization feature to speed up your testing:: the xdist-provided parallelization feature to speed up your testing::
$ py.test --boxed -n3 $ py.test -n3
=========================== test session starts ============================ =========================== test session starts ============================
platform linux2 -- Python 2.7.3 -- pytest-2.3.0.dev8 platform linux2 -- Python 2.7.3 -- pytest-2.3.0.dev8
plugins: xdist, bugzilla, cache, oejskit, cli, pep8, cov plugins: xdist, bugzilla, cache, oejskit, cli, pep8, cov
gw0 I / gw1 I / gw2 I gw0 I / gw1 I / gw2 I
gw0 [50] / gw1 [50] / gw2 [50] gw0 [50] / gw1 [50] / gw2 [50]
scheduling tests via LoadScheduling scheduling tests via LoadScheduling
..f...............f..................f............ ..f...............f..................f............
================================= FAILURES ================================= ================================= FAILURES =================================
......
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)