summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-03-01 16:57:58 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-03-01 16:57:58 (GMT)
commit9c0c101ee4d3f51437d39e17c3a4ff6181b0116d (patch)
tree9314ba4a19fab4f3b9c1cfbb7de533cee7fabad3 /Doc/library
parent8ab50214bd02dfe096525071ff71ee29c958260e (diff)
downloadcpython-9c0c101ee4d3f51437d39e17c3a4ff6181b0116d.zip
cpython-9c0c101ee4d3f51437d39e17c3a4ff6181b0116d.tar.gz
cpython-9c0c101ee4d3f51437d39e17c3a4ff6181b0116d.tar.bz2
whatsnew: unittest discover works on namespace packages (#17457).
I also added the docs that never got committed, editing the patch provided by Claudiu. I collapsed the now three versionchanged directives for discovery into one. I tried several different styles for this. The most obvious is a bulleted list, but currently the only way I could find to produce that is to have *something* appear on the versionchanged line after the colon, which combined with the blank space before the bulleted list just looks wrong. I also tried the current single-line-three-sentences version with bullet characters before each sentence, and I almost went with that as it made it clear that the three sentences are independent. But I decided to just go with the sentences for simplicity reasons.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/unittest.rst21
1 files changed, 12 insertions, 9 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 6ec3609..77323bd 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -239,9 +239,10 @@ Test Discovery
Unittest supports simple test discovery. In order to be compatible with test
discovery, all of the test files must be :ref:`modules <tut-modules>` or
-:ref:`packages <tut-packages>` importable from the top-level directory of
-the project (this means that their filenames must be valid
-:ref:`identifiers <identifiers>`).
+:ref:`packages <tut-packages>` (including :term:`namespace packages
+<namespace package>`) importable from the top-level directory of
+the project (this means that their filenames must be valid :ref:`identifiers
+<identifiers>`).
Test discovery is implemented in :meth:`TestLoader.discover`, but can also be
used from the command line. The basic command-line usage is::
@@ -306,6 +307,9 @@ as the start directory.
Test modules and packages can customize test loading and discovery by through
the `load_tests protocol`_.
+.. versionchanged:: 3.4
+ Test discovery supports :term:`namespace packages <namespace package>`.
+
.. _organizing-tests:
@@ -1654,12 +1658,11 @@ Loading and running tests
.. versionchanged:: 3.4
Modules that raise :exc:`SkipTest` on import are recorded as skips,
- not errors.
-
- .. versionchanged:: 3.4
- Paths are sorted before being imported to ensure execution order for a
- given test suite is the same even if the underlying file system's ordering
- is not dependent on file name like in ext3/4.
+ not errors.
+ Discovery works for :term:`namespace packages <namespace package>`.
+ Paths are sorted before being imported so that execution order is
+ the same even if the underlying file system's ordering is not
+ dependent on file name.
The following attributes of a :class:`TestLoader` can be configured either by