Skip to content

Commit f50652a

Browse files
authored
Merge pull request #9111 from ziebam/iss4320-better-docs-for-testdir-copy-example
2 parents fe44409 + 70a3c96 commit f50652a

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ Michael Goerz
224224
Michael Krebs
225225
Michael Seifert
226226
Michal Wajszczuk
227+
Michał Zięba
227228
Mihai Capotă
228229
Mike Hoyle (hoylemd)
229230
Mike Lundy

changelog/4320.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improved docs for `pytester.copy_example`.

doc/en/how-to/writing_plugins.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,12 @@ return a result object, with which we can assert the tests' outcomes.
416416
result.assert_outcomes(passed=4)
417417
418418
419-
Additionally it is possible to copy examples for an example folder before running pytest on it.
419+
Additionally it is possible to copy examples to the ``pytester``'s isolated environment
420+
before running pytest on it. This way we can abstract the tested logic to separate files,
421+
which is especially useful for longer tests and/or longer ``conftest.py`` files.
422+
423+
Note that for ``pytester.copy_example`` to work we need to set `pytester_example_dir`
424+
in our ``pytest.ini`` to tell pytest where to look for example files.
420425

421426
.. code-block:: ini
422427

0 commit comments

Comments
 (0)