From 93a68cdfb4731b3592002a2dbdd7d18e8afb7919 Mon Sep 17 00:00:00 2001 From: Niklas Meinzer Date: Fri, 28 Jun 2019 18:13:47 +0200 Subject: [PATCH 01/14] doc(plugin_hooks): Improve documentation for writing plugin hooks. --- changelog/5517.doc.rst | 1 + doc/en/writing_plugins.rst | 52 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 changelog/5517.doc.rst diff --git a/changelog/5517.doc.rst b/changelog/5517.doc.rst new file mode 100644 index 000000000..92102c983 --- /dev/null +++ b/changelog/5517.doc.rst @@ -0,0 +1 @@ +Improve "Declaring new hooks" section in chapter "Writing Plugins" diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 469ee57ca..4fb1948b9 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -621,12 +621,60 @@ the new plugin: Hooks are usually declared as do-nothing functions that contain only documentation describing when the hook will be called and what return values -are expected. +are expected. The names of the functions must start with `pytest_` otherwise pytest won't recognize them. -For an example, see `newhooks.py`_ from `xdist `_. +Here's an example. Let's assume this code is in the ``hooks.py`` module. + +.. code-block:: python + + def pytest_my_hook(config): + """ + Receives the pytest config and does things with it + """ + +To register the hooks with pytest they need to be structured in their own module or class. This +class or module can then be passed to the ``pluginmanager`` using the ``pytest_addhooks`` function +(which itself is a hook exposed by pytest). + +.. code-block:: python + + def pytest_addhooks(pluginmanager): + """ This example assumes the hooks are grouped in the 'hooks' module. """ + from my_app.tests import hooks + pluginmanager.add_hookspecs(hooks) + +For a real world example, see `newhooks.py`_ from `xdist `_. .. _`newhooks.py`: https://github.com/pytest-dev/pytest-xdist/blob/974bd566c599dc6a9ea291838c6f226197208b46/xdist/newhooks.py +Hooks may be called both from fixtures or from other hooks. In both cases, hooks are called +through the ``hook`` object, available in the ``config`` object. Most hooks receive a +``config`` object directly, while fixtures may use the ``pytestconfig`` fixture which provides the same object. + +.. code-block:: python + + @pytest.fixture() + def my_fixture(pytestconfig): + # call the hook called "pytest_my_hook" + # `result` will be a list of return values from all registered functions. + result = pytestconfig.hook.pytest_my_hook(config=pytestconfig) + +.. note:: + Hooks receive parameters using only keyword arguments. + +Now your hook is ready to be used. To register a function at the hook, other plugins or users must +now simply define the function ``pytest_my_hook`` with the correct signature in their ``conftest.py``. + +Example: + +.. code-block:: python + + def pytest_my_hook(config): + """ + Print all active hooks to the screen. + """ + print(config.hook) + Optionally using hooks from 3rd party plugins --------------------------------------------- From 789a3662ce7aa1dad3eea208d6d8dc191f50e506 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 09:11:09 -0300 Subject: [PATCH 02/14] Fix linting --- doc/en/writing_plugins.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 4fb1948b9..1596eeb54 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -641,6 +641,7 @@ class or module can then be passed to the ``pluginmanager`` using the ``pytest_a def pytest_addhooks(pluginmanager): """ This example assumes the hooks are grouped in the 'hooks' module. """ from my_app.tests import hooks + pluginmanager.add_hookspecs(hooks) For a real world example, see `newhooks.py`_ from `xdist `_. @@ -656,7 +657,7 @@ through the ``hook`` object, available in the ``config`` object. Most hooks rece @pytest.fixture() def my_fixture(pytestconfig): # call the hook called "pytest_my_hook" - # `result` will be a list of return values from all registered functions. + # 'result' will be a list of return values from all registered functions. result = pytestconfig.hook.pytest_my_hook(config=pytestconfig) .. note:: From 9021194efd9fb253901c11a2a1fb83e7e8585dbf Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 11:13:24 -0300 Subject: [PATCH 03/14] Apply workaround for multiple short options for Python <= 3.8 Hopefully by Python 3.9 this will be fixed upstream, if not we will need to bump the version again. Fix #5523 --- changelog/5523.bugfix.rst | 1 + src/_pytest/config/argparsing.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/5523.bugfix.rst diff --git a/changelog/5523.bugfix.rst b/changelog/5523.bugfix.rst new file mode 100644 index 000000000..5155b92b1 --- /dev/null +++ b/changelog/5523.bugfix.rst @@ -0,0 +1 @@ +Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+. diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index d62ed0d03..43cf62ab1 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -358,7 +358,7 @@ class MyOptionParser(argparse.ArgumentParser): getattr(args, FILE_OR_DIR).extend(argv) return args - if sys.version_info[:2] < (3, 8): # pragma: no cover + if sys.version_info[:2] < (3, 9): # pragma: no cover # Backport of https://github.com/python/cpython/pull/14316 so we can # disable long --argument abbreviations without breaking short flags. def _parse_optional(self, arg_string): From 94a05e513ebf7cf32ec9eaa8f0ba1930a970a8e7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 11:19:50 -0300 Subject: [PATCH 04/14] Run py38-xdist as part of the build instead of cron --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2dd424e58..8053eed65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,10 +55,8 @@ jobs: - env: TOXENV=py37-pluggymaster-xdist - env: TOXENV=py37-freeze - # Jobs only run via Travis cron jobs (currently daily). - env: TOXENV=py38-xdist python: '3.8-dev' - if: type = cron - stage: baseline env: TOXENV=py36-xdist From 9972c78cfa5854fa6ce03fd84b20998b0c7daf84 Mon Sep 17 00:00:00 2001 From: AmirElkess Date: Sun, 30 Jun 2019 18:29:37 +0200 Subject: [PATCH 05/14] update CONTRIBUTING.rst The following edits are for the "Preparing pull requests" section only. 1. remove Python2-related commands. 2. clarifying some details for beginners. Such as that pre-commit must to be installed as admin to function properly. 3. Added "You may not create a changelog entry if the change doesn't affect the documented behaviour of Pytest." on line 270. --- CONTRIBUTING.rst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ec053c081..128df6661 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -169,7 +169,7 @@ Short version #. Follow **PEP-8** for naming and `black `_ for formatting. #. Tests are run using ``tox``:: - tox -e linting,py27,py37 + tox -e linting,py37 The test environments above are usually enough to cover most cases locally. @@ -217,7 +217,9 @@ Here is a simple overview, with pytest-specific bits: If you need some help with Git, follow this quick start guide: https://git.wiki.kernel.org/index.php/QuickStart -#. Install `pre-commit `_ and its hook on the pytest repo:: +#. Install `pre-commit `_ and its hook on the pytest repo: + + **Note: pre-commit must be installed as admin, as it will not function otherwise**:: $ pip install --user pre-commit $ pre-commit install @@ -237,20 +239,20 @@ Here is a simple overview, with pytest-specific bits: #. Run all the tests - You need to have Python 2.7 and 3.7 available in your system. Now + You need to have Python 3.7 available in your system. Now running tests is as simple as issuing this command:: - $ tox -e linting,py27,py37 + $ tox -e linting,py37 - This command will run tests via the "tox" tool against Python 2.7 and 3.7 + This command will run tests via the "tox" tool against Python 3.7 and also perform "lint" coding-style checks. #. You can now edit your local working copy and run the tests again as necessary. Please follow PEP-8 for naming. - You can pass different options to ``tox``. For example, to run tests on Python 2.7 and pass options to pytest + You can pass different options to ``tox``. For example, to run tests on Python 3.7 and pass options to pytest (e.g. enter pdb on failure) to pytest you can do:: - $ tox -e py27 -- --pdb + $ tox -e py37 -- --pdb Or to only run tests in a particular test module on Python 3.7:: @@ -266,7 +268,8 @@ Here is a simple overview, with pytest-specific bits: #. Create a new changelog entry in ``changelog``. The file should be named ``..rst``, where *issueid* is the number of the issue related to the change and *type* is one of - ``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or ``trivial``. + ``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or ``trivial``. You may not create a + changelog entry if the change doesn't affect the documented behaviour of Pytest. #. Add yourself to ``AUTHORS`` file if not there yet, in alphabetical order. From e32c903fb63c8f3476140560dadf7207f0da06d2 Mon Sep 17 00:00:00 2001 From: AmirElkess Date: Sun, 30 Jun 2019 18:32:07 +0200 Subject: [PATCH 06/14] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 087fce8d0..3f73b9272 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,6 +15,7 @@ Alexander Johnson Alexei Kozlenok Allan Feldman Aly Sivji +Amir Elkess Anatoly Bubenkoff Anders Hovmöller Andras Mitzki From 2d9b432613c5f5630854ca7a510e9ff002e5401b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 16:20:17 -0300 Subject: [PATCH 07/14] Add docs about Tidelift and OpenCollective Give an overview of how we as an organization will use the donated money, as well as show this information more prominently in the docs. --- OPENCOLLECTIVE.rst | 44 ++++++++++++++++++++++++++++++++ TIDELIFT.rst | 3 +++ doc/en/_templates/globaltoc.html | 1 + doc/en/contents.rst | 2 +- doc/en/sponsor.rst | 39 ++++++++++++++++++++++++++++ doc/en/tidelift.rst | 4 --- 6 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 OPENCOLLECTIVE.rst create mode 100644 doc/en/sponsor.rst delete mode 100644 doc/en/tidelift.rst diff --git a/OPENCOLLECTIVE.rst b/OPENCOLLECTIVE.rst new file mode 100644 index 000000000..9b7ddcd06 --- /dev/null +++ b/OPENCOLLECTIVE.rst @@ -0,0 +1,44 @@ +============== +OpenCollective +============== + +pytest has a collective setup at `OpenCollective`_. This document describes how the core team manages +OpenCollective-related activities. + +What is it +========== + +Open Collective is an online funding platform for open and transparent communities. +It provide tools to raise money and share your finances in full transparency. + +It is the platform of choice for individuals and companies that want to make one-time or +monthly donations directly to the project. + +Funds +===== + +The OpenCollective funds donated to pytest will be used to fund overall maintenance, +local sprints, merchandising (stickers to distribute in conferences for example), and future +gatherings of pytest developers (Sprints). + +`Core contributors`_ which are contributing on a continuous basis are free to submit invoices +to bill maintenance hours using the platform. How much each contributor should request is still an +open question, but we should use common sense and trust in the contributors, most of which know +themselves in-person. A good rule of thumb is to bill the same amount as monthly payments +contributors which participate in the `Tidelift`_ subscription. If in doubt, just ask. + +Admins +====== + +A few people have admin access to the OpenCollective dashboard to make changes. Those people +are part of the `@pytest-dev/opencollective-admins`_ team. + +`Core contributors`_ interested in helping out with OpenCollective maintenance are welcome! We don't +expect much work here other than the occasional approval of expenses from other core contributors. +Just drop a line to one of the `@pytest-dev/opencollective-admins`_ or use the mailing list. + + +.. _`OpenCollective`: https://opencollective.com/pytest +.. _`Tidelift`: https://tidelift.com +.. _`core contributors`: https://github.com/orgs/pytest-dev/teams/core/members +.. _`@pytest-dev/opencollective-admins`: https://github.com/orgs/pytest-dev/teams/opencollective-admins/members diff --git a/TIDELIFT.rst b/TIDELIFT.rst index f7081817d..062cf6b25 100644 --- a/TIDELIFT.rst +++ b/TIDELIFT.rst @@ -12,6 +12,9 @@ Tidelift aims to make Open Source sustainable by offering subscriptions to compa on Open Source packages. This subscription allows it to pay maintainers of those Open Source packages to aid sustainability of the work. +It is the perfect platform for companies that want to support Open Source packages and at the same +time obtain assurances regarding maintenance, quality and security. + Funds ===== diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html index f4d06a99f..39cebb968 100644 --- a/doc/en/_templates/globaltoc.html +++ b/doc/en/_templates/globaltoc.html @@ -11,6 +11,7 @@
  • Contributing
  • Backwards Compatibility
  • Python 2.7 and 3.4 Support
  • +
  • Sponsor
  • License
  • Contact Channels
  • diff --git a/doc/en/contents.rst b/doc/en/contents.rst index 1ec502c1f..27cbb8c1e 100644 --- a/doc/en/contents.rst +++ b/doc/en/contents.rst @@ -50,7 +50,7 @@ Full pytest documentation projects faq contact - tidelift + sponsor .. only:: html diff --git a/doc/en/sponsor.rst b/doc/en/sponsor.rst new file mode 100644 index 000000000..48bc48d27 --- /dev/null +++ b/doc/en/sponsor.rst @@ -0,0 +1,39 @@ +Sponsor +======= + +pytest is maintained by a team of volunteers from all around the world in their free time. While +we work on pytest because we love the project and use it daily at our daily jobs, monetary +compensation when possible is welcome to justify time away from friends, family and personal time. + +Money is also used to fund local sprints, merchandising (stickers to distribute in conferences for example) +and every few years a large sprint involving all members. + +If you or your company benefit from pytest and would like to contribute to the project financially, +we are members of two online donation platforms to better suit your needs. + +Tidelift +-------- + +`Tidelift`_ aims to make Open Source sustainable by offering subscriptions to companies which rely +on Open Source packages. This subscription allows it to pay maintainers of those Open Source +packages to aid sustainability of the work. + +You can help pytest and the ecosystem by obtaining a `Tidelift subscription`_. + +OpenCollective +-------------- + +`Open Collective`_ is an online funding platform for open and transparent communities. +It provide tools to raise money and share your finances in full transparency. + +It is the platform of choice for individuals and companies that want to make one-time or +monthly donations directly to the project. + +See more datails in the `pytest collective`_. + + + +.. _Tidelift: https://tidelift.com +.. _Tidelift subscription: https://tidelift.com/subscription/pkg/pypi-pytest +.. _Open Collective: https://opencollective.com +.. _pytest collective: https://opencollective.com/pytest diff --git a/doc/en/tidelift.rst b/doc/en/tidelift.rst deleted file mode 100644 index 728bf2219..000000000 --- a/doc/en/tidelift.rst +++ /dev/null @@ -1,4 +0,0 @@ - - - -.. include:: ../../TIDELIFT.rst From fa9791127a8fb2038c5c2d25431c672c5dca9875 Mon Sep 17 00:00:00 2001 From: Andreu Vallbona Plazas Date: Tue, 2 Jul 2019 23:18:52 +0200 Subject: [PATCH 08/14] Added talk about pytest in PyBCN June 2019 Added talk about pytest in PyBCN June 2019 --- doc/en/talks.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/en/talks.rst b/doc/en/talks.rst index be0c6fb9f..82514b347 100644 --- a/doc/en/talks.rst +++ b/doc/en/talks.rst @@ -23,6 +23,8 @@ Books Talks and blog postings --------------------------------------------- +- `pytest: recommendations, basic packages for testing in Python and Django, Andreu Vallbona, PyBCN June 2019 `_. + - pytest: recommendations, basic packages for testing in Python and Django, Andreu Vallbona, PyconES 2017 (`slides in english `_, `video in spanish `_) - `pytest advanced, Andrew Svetlov (Russian, PyCon Russia, 2016) From 1b0e8d73d58e98b44dae1d1b55aea51fc7b28ef3 Mon Sep 17 00:00:00 2001 From: Michael Moore Date: Tue, 2 Jul 2019 23:49:06 -0700 Subject: [PATCH 09/14] Substituted 'yml' to '.yaml' in relevant files --- doc/en/example/nonpython.rst | 14 +++++++------- doc/en/example/nonpython/conftest.py | 2 +- .../{test_simple.yml => test_simple.yaml} | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename doc/en/example/nonpython/{test_simple.yml => test_simple.yaml} (75%) diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index 0910071c1..139677f87 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -12,14 +12,14 @@ A basic example for specifying tests in Yaml files .. _`pytest-yamlwsgi`: http://bitbucket.org/aafshar/pytest-yamlwsgi/src/tip/pytest_yamlwsgi.py .. _`PyYAML`: https://pypi.org/project/PyYAML/ -Here is an example ``conftest.py`` (extracted from Ali Afshnars special purpose `pytest-yamlwsgi`_ plugin). This ``conftest.py`` will collect ``test*.yml`` files and will execute the yaml-formatted content as custom tests: +Here is an example ``conftest.py`` (extracted from Ali Afshnars special purpose `pytest-yamlwsgi`_ plugin). This ``conftest.py`` will collect ``test*.yaml`` files and will execute the yaml-formatted content as custom tests: .. include:: nonpython/conftest.py :literal: You can create a simple example file: -.. include:: nonpython/test_simple.yml +.. include:: nonpython/test_simple.yaml :literal: and if you installed `PyYAML`_ or a compatible YAML-parser you can @@ -27,14 +27,14 @@ now execute the test specification: .. code-block:: pytest - nonpython $ pytest test_simple.yml + nonpython $ pytest test_simple.yaml =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR/nonpython collected 2 items - test_simple.yml F. [100%] + test_simple.yaml F. [100%] ================================= FAILURES ================================= ______________________________ usecase: hello ______________________________ @@ -69,8 +69,8 @@ consulted when reporting in ``verbose`` mode: rootdir: $REGENDOC_TMPDIR/nonpython collecting ... collected 2 items - test_simple.yml::hello FAILED [ 50%] - test_simple.yml::ok PASSED [100%] + test_simple.yaml::hello FAILED [ 50%] + test_simple.yaml::ok PASSED [100%] ================================= FAILURES ================================= ______________________________ usecase: hello ______________________________ @@ -93,7 +93,7 @@ interesting to just look at the collection tree: rootdir: $REGENDOC_TMPDIR/nonpython collected 2 items - + diff --git a/doc/en/example/nonpython/conftest.py b/doc/en/example/nonpython/conftest.py index a1210320e..c94620e97 100644 --- a/doc/en/example/nonpython/conftest.py +++ b/doc/en/example/nonpython/conftest.py @@ -3,7 +3,7 @@ import pytest def pytest_collect_file(parent, path): - if path.ext == ".yml" and path.basename.startswith("test"): + if path.ext == ".yaml" and path.basename.startswith("test"): return YamlFile(path, parent) diff --git a/doc/en/example/nonpython/test_simple.yml b/doc/en/example/nonpython/test_simple.yaml similarity index 75% rename from doc/en/example/nonpython/test_simple.yml rename to doc/en/example/nonpython/test_simple.yaml index f0d8d11fc..8e3e7a4bb 100644 --- a/doc/en/example/nonpython/test_simple.yml +++ b/doc/en/example/nonpython/test_simple.yaml @@ -1,4 +1,4 @@ -# test_simple.yml +# test_simple.yaml ok: sub1: sub1 From 9677099acf4551f481ee4df47ee0989276983205 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 3 Jul 2019 14:26:37 +0200 Subject: [PATCH 10/14] Add upcoming trainings --- doc/en/talks.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/en/talks.rst b/doc/en/talks.rst index 82514b347..20b6e5b09 100644 --- a/doc/en/talks.rst +++ b/doc/en/talks.rst @@ -2,12 +2,11 @@ Talks and Tutorials ========================== -.. - .. sidebar:: Next Open Trainings +.. sidebar:: Next Open Trainings - `Professional Testing with Python - `_, - 26-28 April 2017, Leipzig, Germany. + - `Training at Europython 2019 `_, 8th July 2019, Basel, Switzerland. + + - `Training at Workshoptage 2019 `_ (German), 10th September 2019, Rapperswil, Switzerland. .. _`funcargs`: funcargs.html From 2b9522e9da15107bf3a96083e0221ad6cce47bb6 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 3 Jul 2019 16:42:53 +0100 Subject: [PATCH 11/14] remove documentation about setuptools integration Refs #5534 integrating with `python setup.py test` is not good practice! --- doc/en/goodpractices.rst | 97 ---------------------------------------- 1 file changed, 97 deletions(-) diff --git a/doc/en/goodpractices.rst b/doc/en/goodpractices.rst index 2314c0066..9622cc766 100644 --- a/doc/en/goodpractices.rst +++ b/doc/en/goodpractices.rst @@ -219,101 +219,4 @@ against your source code checkout, helping to detect packaging glitches. -Integrating with setuptools / ``python setup.py test`` / ``pytest-runner`` --------------------------------------------------------------------------- - -You can integrate test runs into your setuptools based project -with the `pytest-runner `_ plugin. - -Add this to ``setup.py`` file: - -.. code-block:: python - - from setuptools import setup - - setup( - # ..., - setup_requires=["pytest-runner", ...], - tests_require=["pytest", ...], - # ..., - ) - - -And create an alias into ``setup.cfg`` file: - - -.. code-block:: ini - - [aliases] - test=pytest - -If you now type:: - - python setup.py test - -this will execute your tests using ``pytest-runner``. As this is a -standalone version of ``pytest`` no prior installation whatsoever is -required for calling the test command. You can also pass additional -arguments to pytest such as your test directory or other -options using ``--addopts``. - -You can also specify other pytest-ini options in your ``setup.cfg`` file -by putting them into a ``[tool:pytest]`` section: - -.. code-block:: ini - - [tool:pytest] - addopts = --verbose - python_files = testing/*/*.py - - -Manual Integration -^^^^^^^^^^^^^^^^^^ - -If for some reason you don't want/can't use ``pytest-runner``, you can write -your own setuptools Test command for invoking pytest. - -.. code-block:: python - - import sys - - from setuptools.command.test import test as TestCommand - - - class PyTest(TestCommand): - user_options = [("pytest-args=", "a", "Arguments to pass to pytest")] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = "" - - def run_tests(self): - import shlex - - # import here, cause outside the eggs aren't loaded - import pytest - - errno = pytest.main(shlex.split(self.pytest_args)) - sys.exit(errno) - - - setup( - # ..., - tests_require=["pytest"], - cmdclass={"pytest": PyTest}, - ) - -Now if you run:: - - python setup.py test - -this will download ``pytest`` if needed and then run your tests -as you would expect it to. You can pass a single string of arguments -using the ``--pytest-args`` or ``-a`` command-line option. For example:: - - python setup.py test -a "--durations=5" - -is equivalent to running ``pytest --durations=5``. - - .. include:: links.inc From caa08ebd4536bbabfb0e1edd3d438be911cfab51 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 4 Jul 2019 05:55:26 -0700 Subject: [PATCH 12/14] Improve quoting in raises match failure message --- changelog/5479.bugfix.rst | 1 + src/_pytest/_code/code.py | 2 +- testing/python/raises.py | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 changelog/5479.bugfix.rst diff --git a/changelog/5479.bugfix.rst b/changelog/5479.bugfix.rst new file mode 100644 index 000000000..d1dd3b0f8 --- /dev/null +++ b/changelog/5479.bugfix.rst @@ -0,0 +1 @@ +Improve quoting in ``raises`` match failure message. diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index b0b4d6531..aa4dcffce 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -544,7 +544,7 @@ class ExceptionInfo: """ __tracebackhide__ = True if not re.search(regexp, str(self.value)): - assert 0, "Pattern '{!s}' not found in '{!s}'".format(regexp, self.value) + assert 0, "Pattern {!r} not found in {!r}".format(regexp, str(self.value)) return True diff --git a/testing/python/raises.py b/testing/python/raises.py index c9ede412a..ed3a5cd37 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -220,13 +220,20 @@ class TestRaises: int("asdf") msg = "with base 16" - expr = r"Pattern '{}' not found in 'invalid literal for int\(\) with base 10: 'asdf''".format( + expr = r"Pattern '{}' not found in \"invalid literal for int\(\) with base 10: 'asdf'\"".format( msg ) with pytest.raises(AssertionError, match=expr): with pytest.raises(ValueError, match=msg): int("asdf", base=10) + def test_match_failure_string_quoting(self): + with pytest.raises(AssertionError) as excinfo: + with pytest.raises(AssertionError, match="'foo"): + raise AssertionError("'bar") + msg, = excinfo.value.args + assert msg == 'Pattern "\'foo" not found in "\'bar"' + def test_raises_match_wrong_type(self): """Raising an exception with the wrong type and match= given. From 8651d880a06c078d8c04ec8c99df1a05bc9826d7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 4 Jul 2019 20:06:50 -0300 Subject: [PATCH 13/14] Handle xfail(strict=True) properly in --step-wise mode Fix #5547 --- changelog/5547.bugfix.rst | 1 + src/_pytest/stepwise.py | 2 +- testing/test_stepwise.py | 53 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 changelog/5547.bugfix.rst diff --git a/changelog/5547.bugfix.rst b/changelog/5547.bugfix.rst new file mode 100644 index 000000000..0345bf048 --- /dev/null +++ b/changelog/5547.bugfix.rst @@ -0,0 +1 @@ +``--step-wise`` now handles ``xfail(strict=True)`` markers properly. diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index eb4555490..a18a58573 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -72,7 +72,7 @@ class StepwisePlugin: def pytest_runtest_logreport(self, report): # Skip this hook if plugin is not active or the test is xfailed. - if not self.active or "xfail" in report.keywords: + if not self.active: return if report.failed: diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py index 40c86fec3..591d67b6c 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -165,3 +165,56 @@ def test_stop_on_collection_errors(broken_testdir, broken_first): files.reverse() result = broken_testdir.runpytest("-v", "--strict-markers", "--stepwise", *files) result.stdout.fnmatch_lines("*errors during collection*") + + +def test_xfail_handling(testdir): + """Ensure normal xfail is ignored, and strict xfail interrupts the session in sw mode + + (#5547) + """ + contents = """ + import pytest + def test_a(): pass + + @pytest.mark.xfail(strict={strict}) + def test_b(): assert {assert_value} + + def test_c(): pass + def test_d(): pass + """ + testdir.makepyfile(contents.format(assert_value="0", strict="False")) + result = testdir.runpytest("--sw", "-v") + result.stdout.fnmatch_lines( + [ + "*::test_a PASSED *", + "*::test_b XFAIL *", + "*::test_c PASSED *", + "*::test_d PASSED *", + "* 3 passed, 1 xfailed in *", + ] + ) + + testdir.makepyfile(contents.format(assert_value="1", strict="True")) + result = testdir.runpytest("--sw", "-v") + result.stdout.fnmatch_lines( + [ + "*::test_a PASSED *", + "*::test_b FAILED *", + "* Interrupted*", + "* 1 failed, 1 passed in *", + ] + ) + + # because we are writing to the same file, mtime might not be affected enough to + # invalidate the cache, making this next run flaky + testdir.tmpdir.join("__pycache__").remove() + testdir.makepyfile(contents.format(assert_value="0", strict="True")) + result = testdir.runpytest("--sw", "-v") + result.stdout.fnmatch_lines( + [ + "*::test_b XFAIL *", + "*::test_c PASSED *", + "*::test_d PASSED *", + "* 2 passed, 1 deselected, 1 xfailed in *", + ] + ) From bb29f31d2278fc93efba7ef3e123616c13ce8022 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 4 Jul 2019 20:01:16 -0400 Subject: [PATCH 14/14] Preparing release version 5.0.1 --- CHANGELOG.rst | 22 ++++++++++++++++++++++ changelog/5479.bugfix.rst | 1 - changelog/5517.doc.rst | 1 - changelog/5523.bugfix.rst | 1 - changelog/5547.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-5.0.1.rst | 25 +++++++++++++++++++++++++ doc/en/assert.rst | 4 ++-- doc/en/cache.rst | 8 ++++---- doc/en/capture.rst | 2 +- doc/en/doctest.rst | 4 ++-- doc/en/example/markers.rst | 28 ++++++++++++++-------------- doc/en/example/nonpython.rst | 12 ++++++------ doc/en/example/parametrize.rst | 21 +++++++++++---------- doc/en/example/pythoncollection.rst | 6 +++--- doc/en/example/reportingdemo.rst | 2 +- doc/en/example/simple.rst | 22 +++++++++++----------- doc/en/fixture.rst | 12 ++++++------ doc/en/getting-started.rst | 4 ++-- doc/en/index.rst | 2 +- doc/en/parametrize.rst | 4 ++-- doc/en/skipping.rst | 2 +- doc/en/tmpdir.rst | 4 ++-- doc/en/unittest.rst | 2 +- doc/en/usage.rst | 6 +++--- doc/en/warnings.rst | 2 +- doc/en/writing_plugins.rst | 2 +- 27 files changed, 123 insertions(+), 78 deletions(-) delete mode 100644 changelog/5479.bugfix.rst delete mode 100644 changelog/5517.doc.rst delete mode 100644 changelog/5523.bugfix.rst delete mode 100644 changelog/5547.bugfix.rst create mode 100644 doc/en/announce/release-5.0.1.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6e5e8985a..c4ab6f1bd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,28 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 5.0.1 (2019-07-04) +========================= + +Bug Fixes +--------- + +- `#5479 `_: Improve quoting in ``raises`` match failure message. + + +- `#5523 `_: Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+. + + +- `#5547 `_: ``--step-wise`` now handles ``xfail(strict=True)`` markers properly. + + + +Improved Documentation +---------------------- + +- `#5517 `_: Improve "Declaring new hooks" section in chapter "Writing Plugins" + + pytest 5.0.0 (2019-06-28) ========================= diff --git a/changelog/5479.bugfix.rst b/changelog/5479.bugfix.rst deleted file mode 100644 index d1dd3b0f8..000000000 --- a/changelog/5479.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Improve quoting in ``raises`` match failure message. diff --git a/changelog/5517.doc.rst b/changelog/5517.doc.rst deleted file mode 100644 index 92102c983..000000000 --- a/changelog/5517.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Improve "Declaring new hooks" section in chapter "Writing Plugins" diff --git a/changelog/5523.bugfix.rst b/changelog/5523.bugfix.rst deleted file mode 100644 index 5155b92b1..000000000 --- a/changelog/5523.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+. diff --git a/changelog/5547.bugfix.rst b/changelog/5547.bugfix.rst deleted file mode 100644 index 0345bf048..000000000 --- a/changelog/5547.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -``--step-wise`` now handles ``xfail(strict=True)`` markers properly. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 700e5361c..84cbdd9d3 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-5.0.1 release-5.0.0 release-4.6.4 release-4.6.3 diff --git a/doc/en/announce/release-5.0.1.rst b/doc/en/announce/release-5.0.1.rst new file mode 100644 index 000000000..541aeb491 --- /dev/null +++ b/doc/en/announce/release-5.0.1.rst @@ -0,0 +1,25 @@ +pytest-5.0.1 +======================================= + +pytest 5.0.1 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/latest/changelog.html. + +Thanks to all who contributed to this release, among them: + +* AmirElkess +* Andreu Vallbona Plazas +* Anthony Sottile +* Bruno Oliveira +* Florian Bruhin +* Michael Moore +* Niklas Meinzer +* Thomas Grainger + + +Happy testing, +The pytest Development Team diff --git a/doc/en/assert.rst b/doc/en/assert.rst index 1e06d9757..465b8d86c 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -31,7 +31,7 @@ you will see the return value of the function call: $ pytest test_assert1.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -186,7 +186,7 @@ if you run this module: $ pytest test_assert2.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item diff --git a/doc/en/cache.rst b/doc/en/cache.rst index c77b985b0..af1d403b5 100644 --- a/doc/en/cache.rst +++ b/doc/en/cache.rst @@ -80,7 +80,7 @@ If you then run it with ``--lf``: $ pytest --lf =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 50 items / 48 deselected / 2 selected @@ -124,7 +124,7 @@ of ``FF`` and dots): $ pytest --ff =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 50 items @@ -256,7 +256,7 @@ You can always peek at the content of the cache using the $ pytest --cache-show =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR cachedir: $PYTHON_PREFIX/.pytest_cache @@ -284,7 +284,7 @@ filtering: $ pytest --cache-show example/* =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR cachedir: $PYTHON_PREFIX/.pytest_cache diff --git a/doc/en/capture.rst b/doc/en/capture.rst index 90403d23a..338996ce8 100644 --- a/doc/en/capture.rst +++ b/doc/en/capture.rst @@ -69,7 +69,7 @@ of the failing function and hide the other one: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items diff --git a/doc/en/doctest.rst b/doc/en/doctest.rst index 2cb70af72..3c40036ef 100644 --- a/doc/en/doctest.rst +++ b/doc/en/doctest.rst @@ -29,7 +29,7 @@ then you can just invoke ``pytest`` directly: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -58,7 +58,7 @@ and functions, including from test modules: $ pytest --doctest-modules =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index c3381600f..004e77add 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -45,7 +45,7 @@ You can then restrict a test run to only run tests marked with ``webtest``: $ pytest -v -m webtest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 4 items / 3 deselected / 1 selected @@ -60,7 +60,7 @@ Or the inverse, running all tests except the webtest ones: $ pytest -v -m "not webtest" =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 4 items / 1 deselected / 3 selected @@ -82,7 +82,7 @@ tests based on their module, class, method, or function name: $ pytest -v test_server.py::TestClass::test_method =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 1 item @@ -97,7 +97,7 @@ You can also select on the class: $ pytest -v test_server.py::TestClass =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 1 item @@ -112,7 +112,7 @@ Or select multiple nodes: $ pytest -v test_server.py::TestClass test_server.py::test_send_http =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 2 items @@ -152,7 +152,7 @@ select tests based on their names: $ pytest -v -k http # running with the above defined example module =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 4 items / 3 deselected / 1 selected @@ -167,7 +167,7 @@ And you can also run all tests except the ones that match the keyword: $ pytest -k "not send_http" -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 4 items / 1 deselected / 3 selected @@ -184,7 +184,7 @@ Or to select "http" and "quick" tests: $ pytest -k "http or quick" -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 4 items / 2 deselected / 2 selected @@ -406,7 +406,7 @@ the test needs: $ pytest -E stage2 =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -421,7 +421,7 @@ and here is one that specifies exactly the environment needed: $ pytest -E stage1 =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -614,7 +614,7 @@ then you will see two tests skipped and two executed tests as expected: $ pytest -rs # this option reports skip reasons =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items @@ -631,7 +631,7 @@ Note that if you specify a platform via the marker-command line option like this $ pytest -m linux =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items / 3 deselected / 1 selected @@ -695,7 +695,7 @@ We can now use the ``-m option`` to select one set: $ pytest -m interface --tb=short =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items / 2 deselected / 2 selected @@ -719,7 +719,7 @@ or to select both "event" and "interface" tests: $ pytest -m "interface or event" --tb=short =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items / 1 deselected / 3 selected diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index 139677f87..75dc764e9 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -29,12 +29,12 @@ now execute the test specification: nonpython $ pytest test_simple.yaml =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR/nonpython collected 2 items - test_simple.yaml F. [100%] + test_simple.yaml F. [100%] ================================= FAILURES ================================= ______________________________ usecase: hello ______________________________ @@ -64,13 +64,13 @@ consulted when reporting in ``verbose`` mode: nonpython $ pytest -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR/nonpython collecting ... collected 2 items - test_simple.yaml::hello FAILED [ 50%] - test_simple.yaml::ok PASSED [100%] + test_simple.yaml::hello FAILED [ 50%] + test_simple.yaml::ok PASSED [100%] ================================= FAILURES ================================= ______________________________ usecase: hello ______________________________ @@ -88,7 +88,7 @@ interesting to just look at the collection tree: nonpython $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR/nonpython collected 2 items diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index a9f006f24..0a5ba8358 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -144,7 +144,7 @@ objects, they are still using the default pytest representation: $ pytest test_time.py --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 8 items @@ -203,7 +203,7 @@ this is a fully self-contained example which you can run with: $ pytest test_scenarios.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items @@ -218,7 +218,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia $ pytest --collect-only test_scenarios.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items @@ -285,7 +285,7 @@ Let's first see how it looks like at collection time: $ pytest test_backends.py --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items @@ -351,7 +351,7 @@ The result of this test will be successful: $ pytest test_indirect_list.py --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -434,10 +434,11 @@ Running it results in some skips if we don't have all the python interpreters in .. code-block:: pytest . $ pytest -rs -q multipython.py - ssssssssssss......sss...... [100%] + ssssssssssss...ssssssssssss [100%] ========================= short test summary info ========================== - SKIPPED [15] $REGENDOC_TMPDIR/CWD/multipython.py:30: 'python3.5' not found - 12 passed, 15 skipped in 0.12 seconds + SKIPPED [12] $REGENDOC_TMPDIR/CWD/multipython.py:30: 'python3.5' not found + SKIPPED [12] $REGENDOC_TMPDIR/CWD/multipython.py:30: 'python3.7' not found + 3 passed, 24 skipped in 0.12 seconds Indirect parametrization of optional implementations/imports -------------------------------------------------------------------- @@ -486,7 +487,7 @@ If you run this with reporting for skips enabled: $ pytest -rs test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items @@ -548,7 +549,7 @@ Then run ``pytest`` with verbose mode and with only the ``basic`` marker: $ pytest -v -m basic =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 17 items / 14 deselected / 3 selected diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 02c12f6bc..6ca5a1eeb 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -146,7 +146,7 @@ The test collection would look like this: $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini collected 2 items @@ -208,7 +208,7 @@ You can always peek at the collection tree without running tests like this: . $ pytest --collect-only pythoncollection.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini collected 3 items @@ -283,7 +283,7 @@ file will be left out: $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini collected 0 items diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 8212c8e24..ae8928c51 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -9,7 +9,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: assertion $ pytest failure_demo.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR/assertion collected 44 items diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 5e405da56..87b68245b 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -127,7 +127,7 @@ directory with the above conftest.py: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 0 items @@ -192,7 +192,7 @@ and when running it will see a skipped "slow" test: $ pytest -rs # "-rs" means report details on the little 's' =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items @@ -209,7 +209,7 @@ Or run it including the ``slow`` marked test: $ pytest --runslow =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items @@ -352,7 +352,7 @@ which will add the string to the test header accordingly: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache project deps: mylib-1.1 rootdir: $REGENDOC_TMPDIR @@ -381,7 +381,7 @@ which will add info only when run with "--v": $ pytest -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache info1: did you know that ... did you? @@ -396,7 +396,7 @@ and nothing when run plainly: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 0 items @@ -436,7 +436,7 @@ Now we can profile which test functions execute the slowest: $ pytest --durations=3 =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 3 items @@ -511,7 +511,7 @@ If we run this: $ pytest -rx =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 4 items @@ -595,7 +595,7 @@ We can run this: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 7 items @@ -709,7 +709,7 @@ and run them: $ pytest test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items @@ -813,7 +813,7 @@ and run it: $ pytest -s test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 3 items diff --git a/doc/en/fixture.rst b/doc/en/fixture.rst index ed9c11b2e..852069731 100644 --- a/doc/en/fixture.rst +++ b/doc/en/fixture.rst @@ -72,7 +72,7 @@ marked ``smtp_connection`` fixture function. Running the test looks like this: $ pytest test_smtpsimple.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -215,7 +215,7 @@ inspect what is going on and can now run the tests: $ pytest test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items @@ -708,7 +708,7 @@ Running the above tests results in the following test IDs being used: $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 10 items @@ -753,7 +753,7 @@ Running this test will *skip* the invocation of ``data_set`` with value ``2``: $ pytest test_fixture_marks.py -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 3 items @@ -798,7 +798,7 @@ Here we declare an ``app`` fixture which receives the previously defined $ pytest -v test_appsetup.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 2 items @@ -869,7 +869,7 @@ Let's run the tests in verbose mode and with looking at the print-output: $ pytest -v -s test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collecting ... collected 8 items diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 5a7b79ec3..750de086e 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -28,7 +28,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - This is pytest version 4.x.y, imported from $PYTHON_PREFIX/lib/python3.6/site-packages/pytest.py + This is pytest version 5.x.y, imported from $PYTHON_PREFIX/lib/python3.6/site-packages/pytest.py .. _`simpletest`: @@ -50,7 +50,7 @@ That’s it. You can now execute the test function: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item diff --git a/doc/en/index.rst b/doc/en/index.rst index 5439770fb..2d6ea620f 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -28,7 +28,7 @@ To execute it: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item diff --git a/doc/en/parametrize.rst b/doc/en/parametrize.rst index 0abe7d701..2e2d846ea 100644 --- a/doc/en/parametrize.rst +++ b/doc/en/parametrize.rst @@ -56,7 +56,7 @@ them in turn: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 3 items @@ -121,7 +121,7 @@ Let's run this: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 3 items diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst index 8d0c499b3..0f57284b3 100644 --- a/doc/en/skipping.rst +++ b/doc/en/skipping.rst @@ -346,7 +346,7 @@ Running it with the report-on-xfail option gives this output: example $ pytest -rx xfail_demo.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR/example collected 7 items diff --git a/doc/en/tmpdir.rst b/doc/en/tmpdir.rst index 01397a5ba..689622956 100644 --- a/doc/en/tmpdir.rst +++ b/doc/en/tmpdir.rst @@ -41,7 +41,7 @@ Running this would result in a passed test except for the last $ pytest test_tmp_path.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item @@ -108,7 +108,7 @@ Running this would result in a passed test except for the last $ pytest test_tmpdir.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item diff --git a/doc/en/unittest.rst b/doc/en/unittest.rst index 05632aef4..a913f72b7 100644 --- a/doc/en/unittest.rst +++ b/doc/en/unittest.rst @@ -128,7 +128,7 @@ the ``self.db`` values in the traceback: $ pytest test_unittest_db.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 2 items diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 74cfaa178..41d51adee 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -204,7 +204,7 @@ Example: $ pytest -ra =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 6 items @@ -258,7 +258,7 @@ More than one character can be used, so for example to only see failed and skipp $ pytest -rfs =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 6 items @@ -294,7 +294,7 @@ captured output: $ pytest -rpP =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 6 items diff --git a/doc/en/warnings.rst b/doc/en/warnings.rst index 8f8d6f3e1..c2b256bb3 100644 --- a/doc/en/warnings.rst +++ b/doc/en/warnings.rst @@ -28,7 +28,7 @@ Running pytest now produces this output: $ pytest test_show_warnings.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR collected 1 item diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 1596eeb54..4bbc1afce 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -429,7 +429,7 @@ additionally it is possible to copy examples for an example folder before runnin $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y + platform linux -- Python 3.x.y, pytest-5.x.y, py-1.x.y, pluggy-0.x.y cachedir: $PYTHON_PREFIX/.pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini collected 2 items