changeset: 97004:45bd2dadbd0d parent: 97001:b97b6cc381d7 parent: 97003:10f5a7fa26d5 user: Robert Collins date: Thu Jul 23 06:40:13 2015 +1200 files: Misc/ACKS Misc/NEWS description: Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero. diff -r b97b6cc381d7 -r 45bd2dadbd0d Doc/library/unittest.rst --- a/Doc/library/unittest.rst Thu Jul 23 06:19:18 2015 +1200 +++ b/Doc/library/unittest.rst Thu Jul 23 06:40:13 2015 +1200 @@ -651,10 +651,8 @@ 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 @@ 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) diff -r b97b6cc381d7 -r 45bd2dadbd0d Misc/ACKS --- a/Misc/ACKS Thu Jul 23 06:19:18 2015 +1200 +++ b/Misc/ACKS Thu Jul 23 06:40:13 2015 +1200 @@ -1585,3 +1585,4 @@ Ignacio Rossi Laurent De Buyst Nicola Palumbo +evilzero diff -r b97b6cc381d7 -r 45bd2dadbd0d Misc/NEWS --- a/Misc/NEWS Thu Jul 23 06:19:18 2015 +1200 +++ b/Misc/NEWS Thu Jul 23 06:40:13 2015 +1200 @@ -51,6 +51,8 @@ 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 explicitly forbidden as well as numeric group references.