summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2015-07-22 18:37:26 (GMT)
committerRobert Collins <rbtcollins@hp.com>2015-07-22 18:37:26 (GMT)
commite02f6c20ff9d017a8d1c8b27d96cbfc205185f06 (patch)
treef73546745b0358e8897beefb36a682ba6a101f60
parent689b55c1cb837c0b89be46b57e52912fe4b2072d (diff)
downloadcpython-e02f6c20ff9d017a8d1c8b27d96cbfc205185f06.zip
cpython-e02f6c20ff9d017a8d1c8b27d96cbfc205185f06.tar.gz
cpython-e02f6c20ff9d017a8d1c8b27d96cbfc205185f06.tar.bz2
Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
-rw-r--r--Doc/library/unittest.rst12
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS2
3 files changed, 11 insertions, 4 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index e7e3262..f13100c 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -644,10 +644,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
@@ -1551,6 +1549,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)
diff --git a/Misc/ACKS b/Misc/ACKS
index 63cf4da..a6a9a9d 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1535,3 +1535,4 @@ Doug Zongker
Peter Åstrand
Laurent De Buyst
Nicola Palumbo
+evilzero
diff --git a/Misc/NEWS b/Misc/NEWS
index a7f42bc..d38c414 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -66,6 +66,8 @@ Core and Builtins
Library
-------
+- Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
+
- Issue #24206: Fixed __eq__ and __ne__ methods of inspect classes.
- Issue #21750: mock_open.read_data can now be read from each instance, as it