File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,18 @@ expected.
2929
3030It's also worth noting that if you want to write exploratory tests as you develop
3131your code, but you *do not * want those tests to be included in automated test runs,
32- feel free to place those tests in a directory outside of the ``./tests `` directory.
32+ feel free to place those tests in a directory outside of the ``./tests `` and
33+ ``./src `` directories.
3334
3435Note that ``pytest `` will recursively search subdirectories inside of ``./tests ``
3536while searching for tests to run.
37+
38+ doctests
39+ -------------------------------------------------------------------------------
40+
41+ In addition to the usual ways of writing unit tests with pytest, our template
42+ supports tests embedded in documentation using pytest's
43+ `doctest <https://doc.pytest.org/en/latest/how-to/doctest.html >`_ component.
44+ Documentation comments in all source files, as well as ``.rst `` files in the ``./docs ``
45+ directory can contain doctests in the format outlined
46+ `here <https://doc.pytest.org/en/latest/how-to/doctest.html >`_.
Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ write_to = "src/{{package_name}}/_version.py"
6363[tool.pytest.ini_options]
6464testpaths = [
6565 "tests",
66+ "src",
67+ "docs",
6668]
69+ addopts = "--doctest-modules --doctest-glob=*.rst"
6770
6871[tool.black]
6972line-length = 110
You can’t perform that action at this time.
0 commit comments