Kaydet (Commit) 38de40db authored tarafından Robert Collins's avatar Robert Collins

Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.

...@@ -651,10 +651,8 @@ Test cases ...@@ -651,10 +651,8 @@ Test cases
kinds of failure. kinds of failure.
Each instance of :class:`TestCase` will run a single base method: the method Each instance of :class:`TestCase` will run a single base method: the method
named *methodName*. However, the standard implementation of the default named *methodName*.
*methodName*, ``runTest()``, will run every method starting with ``test`` In most uses of :class:`TestCase`, you will neither change
as an individual test, and count successes and failures accordingly.
Therefore, in most uses of :class:`TestCase`, you will neither change
the *methodName* nor reimplement the default ``runTest()`` method. the *methodName* nor reimplement the default ``runTest()`` method.
.. versionchanged:: 3.2 .. versionchanged:: 3.2
...@@ -1572,6 +1570,12 @@ Loading and running tests ...@@ -1572,6 +1570,12 @@ Loading and running tests
Return a suite of all tests cases contained in the :class:`TestCase`\ -derived Return a suite of all tests cases contained in the :class:`TestCase`\ -derived
:class:`testCaseClass`. :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) .. method:: loadTestsFromModule(module, pattern=None)
......
...@@ -1584,3 +1584,4 @@ Peter Åstrand ...@@ -1584,3 +1584,4 @@ Peter Åstrand
Ignacio Rossi Ignacio Rossi
Laurent De Buyst Laurent De Buyst
Nicola Palumbo Nicola Palumbo
evilzero
...@@ -25,6 +25,8 @@ Core and Builtins ...@@ -25,6 +25,8 @@ Core and Builtins
Library Library
------- -------
- Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
- Issue #24580: Symbolic group references to open group in re patterns now are - Issue #24580: Symbolic group references to open group in re patterns now are
explicitly forbidden as well as numeric group references. explicitly forbidden as well as numeric group references.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment