From 520aa61e19d5487b71739e6c2ef0e9c1dd679922 Mon Sep 17 00:00:00 2001 From: ziebam Date: Wed, 22 Sep 2021 00:16:52 +0200 Subject: [PATCH 1/3] Improve docs for pytester.copy_example --- doc/en/how-to/writing_plugins.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index e461e2add..0157863e1 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -416,7 +416,12 @@ return a result object, with which we can assert the tests' outcomes. result.assert_outcomes(passed=4) -Additionally it is possible to copy examples for an example folder before running pytest on it. +Additionally it is possible to copy examples to the ``pytester``'s isolated environment +before running pytest on it. This way we can abstract the tested logic to separate files, +which is especially useful for longer tests and/or longer ``conftest.py`` files. + +Note that for ``pytester.copy_example`` to work we need to set `pytester_example_dir` +in our ``pytest.ini`` to tell pytest where to look for example files. .. code-block:: ini From 6ea762c46cc89e833bdd6280ee9cc2160ca3f9ff Mon Sep 17 00:00:00 2001 From: ziebam Date: Wed, 22 Sep 2021 00:22:37 +0200 Subject: [PATCH 2/3] Add a changelog entry --- changelog/4320.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/4320.doc.rst diff --git a/changelog/4320.doc.rst b/changelog/4320.doc.rst new file mode 100644 index 000000000..70a4a743f --- /dev/null +++ b/changelog/4320.doc.rst @@ -0,0 +1 @@ +Improved docs for `pytester.copy_example`. From 70a3c965eac242fbb10a2ebd12b4f3abee0c624d Mon Sep 17 00:00:00 2001 From: ziebam Date: Wed, 22 Sep 2021 00:23:13 +0200 Subject: [PATCH 3/3] Add myself to AUTHORS file --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index d5a107103..bfc2d3e46 100644 --- a/AUTHORS +++ b/AUTHORS @@ -224,6 +224,7 @@ Michael Goerz Michael Krebs Michael Seifert Michal Wajszczuk +Michał Zięba Mihai Capotă Mike Hoyle (hoylemd) Mike Lundy