bpo-23882: Doc: Clarify unittest discovery document (GH-21560) · python/cpython@30fe3ee

Original file line numberDiff line numberDiff line change

@@ -330,7 +330,9 @@ Test modules and packages can customize test loading and discovery by through

330330

the `load_tests protocol`_.

331331
332332

.. versionchanged:: 3.4

333-

Test discovery supports :term:`namespace packages <namespace package>`.

333+

Test discovery supports :term:`namespace packages <namespace package>`

334+

for start directory. Note that you need to the top level directory too.

335+

(e.g. ``python -m unittest discover -s root/namespace -t root``).

334336
335337
336338

.. _organizing-tests:

@@ -1849,11 +1851,15 @@ Loading and running tests

18491851
18501852

.. versionchanged:: 3.4

18511853

Modules that raise :exc:`SkipTest` on import are recorded as skips,

1852-

not errors.

1853-

Discovery works for :term:`namespace packages <namespace package>`.

1854-

Paths are sorted before being imported so that execution order is

1855-

the same even if the underlying file system's ordering is not

1856-

dependent on file name.

1854+

not errors.

1855+
1856+

.. versionchanged:: 3.4

1857+

*start_dir* can be a :term:`namespace packages <namespace package>`.

1858+
1859+

.. versionchanged:: 3.4

1860+

Paths are sorted before being imported so that execution order is the

1861+

same even if the underlying file system's ordering is not dependent

1862+

on file name.

18571863
18581864

.. versionchanged:: 3.5

18591865

Found packages are now checked for ``load_tests`` regardless of