Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytester runexamples #3623

Diff settings


Just for now


regendoc and invocation fixes

  • Loading branch information...
RonnyPfannschmidt committed Jun 27, 2018
commit 17e01993d9a751a0d04b72991faddebad38183a4
@@ -390,32 +390,41 @@ additionally it is possible to copy examples for a example folder before running

.. code:: ini

# contents of pytest.ini
# content of pytest.ini
pytester_example_dir = .

.. code:: python
# contents of
# content of
def test_plugin(testdir):
testdir.runpytest("-k 'not test_plugin'")
testdir.runpytest("-k", "test_example")
def test_example():
.. code::

$ pytest -k test_plugin
$ pytest
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
rootdir: $REGENDOC_TMPDIR, inifile:
collected 0 items
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
collected 2 items .. [100%]

============================= warnings summary =============================
$REGENDOC_TMPDIR/ PytestExerimentalApiWarning: testdir.copy_example is an experimental api that may change over time

-- Docs:
=================== 2 passed, 1 warnings in 0.12 seconds ===================

======================= no tests ran in 0.12 seconds =======================
For more information about the result object that ``runpytest()`` returns, and
the methods that it provides please check out the :py:class:`RunResult
<_pytest.pytester.RunResult>` documentation.
@@ -1,5 +1,13 @@
class PytestExerimentalApiWarning(FutureWarning):
"warning category used to denote experiments in pytest"

def simple(cls, apiname):
return cls(
"{apiname} is an experimental api that may change over time".format(

PYTESTER_COPY_EXAMPLE = PytestExerimentalApiWarning()

PYTESTER_COPY_EXAMPLE = PytestExerimentalApiWarning.simple("testdir.copy_example")
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.