Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d17b30

Browse files
committed
Several updates to cover omissions noted by Rich Salz.
This closes SF bug #458771.
1 parent f5072b9 commit 4d17b30

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

Doc/lib/libunittest.tex

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,19 @@ \subsection{TestSuite Objects
579579
\class{TestSuite} instances to this test suite.
580580
\end{methoddesc}
581581

582+
The \method{run()} method is also slightly different:
583+
584+
\begin{methoddesc}[TestSuite]{run}{result}
585+
Run the tests associated with this suite, collecting the result into
586+
the test result object passed as \var{result}. Note that unlike
587+
\method{TestCase.run()}, \method{TestSuite.run()} requires the
588+
result object to be passed in.
589+
\end{methoddesc}
590+
591+
In the typical usage of a \class{TestSuite} object, the \method{run()}
592+
method is invoked by a \class{TestRunner} rather than by the end-user
593+
test harness.
594+
582595

583596
\subsection{TestResult Objects
584597
\label{testresult-objects}}
@@ -706,9 +719,20 @@ \subsection{TestLoader Objects
706719
\begin{methoddesc}[TestLoader]{loadTestsFromName}{name\optional{, module}}
707720
Return a suite of all tests cases given a string specifier.
708721

709-
The specifier \var{name} may resolve either to a module, a test case
710-
class, a test method within a test case class, or a callable object
711-
which returns a \class{TestCase} or \class{TestSuite} instance.
722+
The specifier \var{name} is a ``dotted name'' that may resolve
723+
either to a module, a test case class, a test method within a test
724+
case class, or a callable object which returns a \class{TestCase} or
725+
\class{TestSuite} instance. For example, if you have a module
726+
\module{SampleTests} containing a \class{TestCase}-derived class
727+
\class{SampleTestCase} with three test methods (\method{test_one()},
728+
\method{test_two()}, and \method{test_three()}), the specifier
729+
\code{'SampleTests.SampleTestCase'} would cause this method to
730+
return a suite which will run all three test methods. Using the
731+
specifier \code{'SampleTests.SampleTestCase.test_two'} would cause
732+
it to return a test suite which will run only the
733+
\method{test_two()} test method. The specifier can refer to modules
734+
and packages which have not been imported; they will be imported as
735+
a side-effect.
712736

713737
The method optionally resolves \var{name} relative to a given module.
714738
\end{methoddesc}

0 commit comments

Comments
 (0)