summaryrefslogtreecommitdiffstats
path: root/Doc/library/test.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/test.rst')
-rw-r--r--Doc/library/test.rst17
1 files changed, 16 insertions, 1 deletions
diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index 83026d8..7a7182a 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -461,7 +461,7 @@ The :mod:`test.support` module defines the following functions:
.. function:: make_bad_fd()
Create an invalid file descriptor by opening and closing a temporary file,
- and returning its descripor.
+ and returning its descriptor.
.. function:: import_module(name, deprecated=False)
@@ -554,6 +554,21 @@ The :mod:`test.support` module defines the following functions:
run simultaneously, which is a problem for buildbots.
+.. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern)
+
+ Generic implementation of the :mod:`unittest` ``load_tests`` protocol for
+ use in test packages. *pkg_dir* is the root directory of the package;
+ *loader*, *standard_tests*, and *pattern* are the arguments expected by
+ ``load_tests``. In simple cases, the test package's ``__init__.py``
+ can be the following::
+
+ import os
+ from test.support import load_package_tests
+
+ def load_tests(*args):
+ return load_package_tests(os.path.dirname(__file__), *args)
+
+
The :mod:`test.support` module defines the following classes:
.. class:: TransientResource(exc, **kwargs)