summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-22 18:39:06 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-22 18:39:06 (GMT)
commit38de40db004e84e98a6a30204fc8cb382bb4d7bd (patch)
tree1d557bdd0d4eeffaa1b7e00ab812a45077036631 /Doc/library
parentb5754321d041938ca30f74e4141e97655b588646 (diff)
parente02f6c20ff9d017a8d1c8b27d96cbfc205185f06 (diff)
downloadcpython-38de40db004e84e98a6a30204fc8cb382bb4d7bd.zip
cpython-38de40db004e84e98a6a30204fc8cb382bb4d7bd.tar.gz
cpython-38de40db004e84e98a6a30204fc8cb382bb4d7bd.tar.bz2
Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/unittest.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index cfce019..5085703 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -651,10 +651,8 @@ Test cases
kinds of failure.
Each instance of :class:`TestCase` will run a single base method: the method
- named *methodName*. However, the standard implementation of the default
- *methodName*, ``runTest()``, will run every method starting with ``test``
- as an individual test, and count successes and failures accordingly.
- Therefore, in most uses of :class:`TestCase`, you will neither change
+ named *methodName*.
+ In most uses of :class:`TestCase`, you will neither change
the *methodName* nor reimplement the default ``runTest()`` method.
.. versionchanged:: 3.2
@@ -1572,6 +1570,12 @@ Loading and running tests
Return a suite of all tests cases contained in the :class:`TestCase`\ -derived
:class:`testCaseClass`.
+ A test case instance is created for each method named by
+ :meth:`getTestCaseNames`. By default these are the method names
+ beginning with ``test``. If :meth:`getTestCaseNames` returns no
+ methods, but the :meth:`runTest` method is implemented, a single test
+ case is created for that method instead.
+
.. method:: loadTestsFromModule(module, pattern=None)