Mailing List Archive

bpo-23882: Doc: Clarify unittest discovery document (GH-21560)
https://github.com/python/cpython/commit/5a4aa4c03e27ca5007b86c9c1ee62c77ad08a120
commit: 5a4aa4c03e27ca5007b86c9c1ee62c77ad08a120
branch: master
author: Inada Naoki <songofacandy@gmail.com>
committer: methane <songofacandy@gmail.com>
date: 2021-02-22T15:14:26+09:00
summary:

bpo-23882: Doc: Clarify unittest discovery document (GH-21560)

Unittest discovery support namespace package as start
directory. But it doesn't find namespace package in
the start directory automatically.

Otherwise, unittest discovery search into unexpected
directories like `vendor/` or `node_modules/`.

files:
M Doc/library/unittest.rst

diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index bb229f0bf9ce0..d413224fd4983 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -330,7 +330,9 @@ 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>`.
+ Test discovery supports :term:`namespace packages <namespace package>`
+ for start directory. Note that you need to the top level directory too.
+ (e.g. ``python -m unittest discover -s root/namespace -t root``).


.. _organizing-tests:
@@ -1870,11 +1872,15 @@ Loading and running tests

.. versionchanged:: 3.4
Modules that raise :exc:`SkipTest` on import are recorded as skips,
- 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.
+ not errors.
+
+ .. versionchanged:: 3.4
+ *start_dir* can be a :term:`namespace packages <namespace package>`.
+
+ .. versionchanged:: 3.4
+ 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.

.. versionchanged:: 3.5
Found packages are now checked for ``load_tests`` regardless of

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins
bpo-23882: Doc: Clarify unittest discovery document (GH-21560) [ In reply to ]
https://github.com/python/cpython/commit/9dd018e35cce30bc2545290b6083dbf6e50d7b61
commit: 9dd018e35cce30bc2545290b6083dbf6e50d7b61
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: miss-islington <31488909+miss-islington@users.noreply.github.com>
date: 2021-02-21T22:24:54-08:00
summary:

bpo-23882: Doc: Clarify unittest discovery document (GH-21560)


Unittest discovery support namespace package as start
directory. But it doesn't find namespace package in
the start directory automatically.

Otherwise, unittest discovery search into unexpected
directories like `vendor/` or `node_modules/`.
(cherry picked from commit 5a4aa4c03e27ca5007b86c9c1ee62c77ad08a120)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>

files:
M Doc/library/unittest.rst

diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index af2f46cfe8f6a..cdac92709161e 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -330,7 +330,9 @@ 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>`.
+ Test discovery supports :term:`namespace packages <namespace package>`
+ for start directory. Note that you need to the top level directory too.
+ (e.g. ``python -m unittest discover -s root/namespace -t root``).


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

.. versionchanged:: 3.4
Modules that raise :exc:`SkipTest` on import are recorded as skips,
- 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.
+ not errors.
+
+ .. versionchanged:: 3.4
+ *start_dir* can be a :term:`namespace packages <namespace package>`.
+
+ .. versionchanged:: 3.4
+ 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.

.. versionchanged:: 3.5
Found packages are now checked for ``load_tests`` regardless of

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins
bpo-23882: Doc: Clarify unittest discovery document (GH-21560) [ In reply to ]
https://github.com/python/cpython/commit/30fe3ee6d39fba8183db779f15936fe64cc5ec85
commit: 30fe3ee6d39fba8183db779f15936fe64cc5ec85
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
committer: miss-islington <31488909+miss-islington@users.noreply.github.com>
date: 2021-02-21T22:37:18-08:00
summary:

bpo-23882: Doc: Clarify unittest discovery document (GH-21560)


Unittest discovery support namespace package as start
directory. But it doesn't find namespace package in
the start directory automatically.

Otherwise, unittest discovery search into unexpected
directories like `vendor/` or `node_modules/`.
(cherry picked from commit 5a4aa4c03e27ca5007b86c9c1ee62c77ad08a120)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>

files:
M Doc/library/unittest.rst

diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 9fc6620335f88..d05e15e7808f9 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -330,7 +330,9 @@ 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>`.
+ Test discovery supports :term:`namespace packages <namespace package>`
+ for start directory. Note that you need to the top level directory too.
+ (e.g. ``python -m unittest discover -s root/namespace -t root``).


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

.. versionchanged:: 3.4
Modules that raise :exc:`SkipTest` on import are recorded as skips,
- 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.
+ not errors.
+
+ .. versionchanged:: 3.4
+ *start_dir* can be a :term:`namespace packages <namespace package>`.
+
+ .. versionchanged:: 3.4
+ 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.

.. versionchanged:: 3.5
Found packages are now checked for ``load_tests`` regardless of

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins