Skip to content

Commit 520aa61

Browse files
author
ziebam
committed
Improve docs for pytester.copy_example
1 parent fe44409 commit 520aa61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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)