diff --git a/changelog/5669.doc.rst b/changelog/5669.doc.rst new file mode 100644 index 00000000000..0ec9626ae50 --- /dev/null +++ b/changelog/5669.doc.rst @@ -0,0 +1 @@ +Add docstring for ``Testdir.copy_example``. diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 2068761faf9..29c200ce6dc 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -630,6 +630,12 @@ def mkpydir(self, name): return p def copy_example(self, name=None): + """Copy file from project's directory into the testdir. + + :param str name: The name of the file for copy. + :return: path to the copied directory (inside ``self.tmpdir``). + + """ import warnings from _pytest.warning_types import PYTESTER_COPY_EXAMPLE