Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(202420)

Side by Side Diff: Doc/library/unittest.rst

Issue 18729: In unittest.TestLoader.discover doc select the name of load_tests function
Patch Set: Created 6 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`unittest` --- Unit testing framework 1 :mod:`unittest` --- Unit testing framework
2 ========================================== 2 ==========================================
3 3
4 .. module:: unittest 4 .. module:: unittest
5 :synopsis: Unit testing framework for Python. 5 :synopsis: Unit testing framework for Python.
6 .. moduleauthor:: Steve Purcell <stephen_purcell@yahoo.com> 6 .. moduleauthor:: Steve Purcell <stephen_purcell@yahoo.com>
7 .. sectionauthor:: Steve Purcell <stephen_purcell@yahoo.com> 7 .. sectionauthor:: Steve Purcell <stephen_purcell@yahoo.com>
8 .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> 8 .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
9 .. sectionauthor:: Raymond Hettinger <python@rcn.com> 9 .. sectionauthor:: Raymond Hettinger <python@rcn.com>
10 10
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 If importing a module fails, for example due to a syntax error, then this 1579 If importing a module fails, for example due to a syntax error, then this
1580 will be recorded as a single error and discovery will continue. If the 1580 will be recorded as a single error and discovery will continue. If the
1581 import failure is due to :exc:`SkipTest` being raised, it will be recorded 1581 import failure is due to :exc:`SkipTest` being raised, it will be recorded
1582 as a skip instead of an error. 1582 as a skip instead of an error.
1583 1583
1584 If a test package name (directory with :file:`__init__.py`) matches the 1584 If a test package name (directory with :file:`__init__.py`) matches the
1585 pattern then the package will be checked for a ``load_tests`` 1585 pattern then the package will be checked for a ``load_tests``
1586 function. If this exists then it will be called with *loader*, *tests*, 1586 function. If this exists then it will be called with *loader*, *tests*,
1587 *pattern*. 1587 *pattern*.
1588 1588
1589 If load_tests exists then discovery does *not* recurse into the package, 1589 If ``load_tests`` exists then discovery does *not* recurse into the packag e,
1590 ``load_tests`` is responsible for loading all tests in the package. 1590 ``load_tests`` is responsible for loading all tests in the package.
1591 1591
1592 The pattern is deliberately not stored as a loader attribute so that 1592 The pattern is deliberately not stored as a loader attribute so that
1593 packages can continue discovery themselves. *top_level_dir* is stored so 1593 packages can continue discovery themselves. *top_level_dir* is stored so
1594 ``load_tests`` does not need to pass this argument in to 1594 ``load_tests`` does not need to pass this argument in to
1595 ``loader.discover()``. 1595 ``loader.discover()``.
1596 1596
1597 *start_dir* can be a dotted module name as well as a directory. 1597 *start_dir* can be a dotted module name as well as a directory.
1598 1598
1599 .. versionadded:: 3.2 1599 .. versionadded:: 3.2
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 2146
2147 .. function:: removeHandler(function=None) 2147 .. function:: removeHandler(function=None)
2148 2148
2149 When called without arguments this function removes the control-c handler 2149 When called without arguments this function removes the control-c handler
2150 if it has been installed. This function can also be used as a test decorator 2150 if it has been installed. This function can also be used as a test decorator
2151 to temporarily remove the handler whilst the test is being executed:: 2151 to temporarily remove the handler whilst the test is being executed::
2152 2152
2153 @unittest.removeHandler 2153 @unittest.removeHandler
2154 def test_signal_handling(self): 2154 def test_signal_handling(self):
2155 ... 2155 ...
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+