Skip to content

Commit a6084ed

Browse files
authored
Merge pull request #2090 from avojnovicDk/issue-1808
Clarify test discovery docs.
2 parents d05d19d + 2e6a58a commit a6084ed

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/en/goodpractices.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ Conventions for Python test discovery
1616
* If no arguments are specified then collection starts from :confval:`testpaths`
1717
(if configured) or the current directory. Alternatively, command line arguments
1818
can be used in any combination of directories, file names or node ids.
19-
* recurse into directories, unless they match :confval:`norecursedirs`
20-
* ``test_*.py`` or ``*_test.py`` files, imported by their `test package name`_.
21-
* ``Test`` prefixed test classes (without an ``__init__`` method)
22-
* ``test_`` prefixed test functions or methods are test items
19+
* Recurse into directories, unless they match :confval:`norecursedirs`.
20+
* In those directories, search for ``test_*.py`` or ``*_test.py`` files, imported by their `test package name`_.
21+
* From those files, collect test items:
22+
23+
* ``test_`` prefixed test functions or methods outside of class
24+
* ``test_`` prefixed test functions or methods inside ``Test`` prefixed test classes (without an ``__init__`` method)
2325

2426
For examples of how to customize your test discovery :doc:`example/pythoncollection`.
2527

0 commit comments

Comments
 (0)