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

Skip to content

Commit 419e3de

Browse files
committed
Fix some markup and style in the unittest docs.
1 parent f7f5a82 commit 419e3de

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

Doc/library/unittest.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,10 @@ Test cases
978978
with self.assertRaisesRegex(ValueError, 'literal'):
979979
int('XYZ')
980980

981-
.. versionadded:: 3.1 ``assertRaisesRegexp``
981+
.. versionadded:: 3.1
982+
under the name ``assertRaisesRegexp``.
982983
.. versionchanged:: 3.2
983-
The method has been renamed to :meth:`assertRaisesRegex`
984+
Renamed to :meth:`assertRaisesRegex`.
984985

985986

986987
.. method:: assertWarns(warning, callable, *args, **kwds)
@@ -1091,9 +1092,9 @@ Test cases
10911092
Supplying both *delta* and *places* raises a ``TypeError``.
10921093

10931094
.. versionchanged:: 3.2
1094-
assertAlmostEqual automatically considers almost equal objects that compare equal.
1095-
assertNotAlmostEqual automatically fails if the objects compare equal.
1096-
Added the ``delta`` keyword argument.
1095+
:meth:`assertAlmostEqual` automatically considers almost equal objects
1096+
that compare equal. :meth:`assertNotAlmostEqual` automatically fails
1097+
if the objects compare equal. Added the *delta* keyword argument.
10971098

10981099

10991100
.. method:: assertGreater(first, second, msg=None)
@@ -1119,10 +1120,13 @@ Test cases
11191120
may be a regular expression object or a string containing a regular
11201121
expression suitable for use by :func:`re.search`.
11211122

1122-
.. versionadded:: 3.1 ``.assertRegexpMatches``
1123+
.. versionadded:: 3.1
1124+
under the name ``assertRegexpMatches``.
11231125
.. versionchanged:: 3.2
1124-
``.assertRegexpMatches`` has been renamed to :meth:`.assertRegex`
1125-
.. versionadded:: 3.2 :meth:`.assertNotRegex`
1126+
The method ``assertRegexpMatches()`` has been renamed to
1127+
:meth:`.assertRegex`.
1128+
.. versionadded:: 3.2
1129+
:meth:`.assertNotRegex`.
11261130

11271131

11281132
.. method:: assertDictContainsSubset(expected, actual, msg=None)
@@ -1359,11 +1363,11 @@ Test cases
13591363
returns the first line of the test method's docstring, if available,
13601364
or ``None``.
13611365

1362-
.. versionchanged:: 3.1,3.2
1366+
.. versionchanged:: 3.1
13631367
In 3.1 this was changed to add the test name to the short description
1364-
even in the presence of a docstring. This caused compatibility issues
1368+
even in the presence of a docstring. This caused compatibility issues
13651369
with unittest extensions and adding the test name was moved to the
1366-
:class:`TextTestResult`.
1370+
:class:`TextTestResult` in Python 3.2.
13671371

13681372

13691373
.. method:: addCleanup(function, *args, **kwargs)
@@ -1715,7 +1719,6 @@ Loading and running tests
17151719
The total number of tests run so far.
17161720

17171721

1718-
.. attribute:: buffer
17191722

17201723
If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in between
17211724
:meth:`startTest` and :meth:`stopTest` being called. Collected output will
@@ -1881,9 +1884,12 @@ Loading and running tests
18811884

18821885
stream, descriptions, verbosity
18831886

1884-
.. versionchanged:: 3.2 Added the ``warnings`` argument
1887+
.. versionchanged:: 3.2
1888+
Added the ``warnings`` argument.
18851889

1886-
.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None, warnings=None)
1890+
.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, \
1891+
testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1, \
1892+
failfast=None, catchbreak=None, buffer=None, warnings=None)
18871893

18881894
A command-line program that runs a set of tests; this is primarily for making
18891895
test modules conveniently executable. The simplest use for this function is to
@@ -1928,10 +1934,8 @@ Loading and running tests
19281934
load_tests Protocol
19291935
###################
19301936

1931-
19321937
.. versionadded:: 3.2
19331938

1934-
19351939
Modules or packages can customize how tests are loaded from them during normal
19361940
test runs or test discovery by implementing a function called ``load_tests``.
19371941

@@ -2078,6 +2082,8 @@ instead of as an error.
20782082
Signal Handling
20792083
---------------
20802084

2085+
.. versionadded:: 3.2
2086+
20812087
The :option:`-c/--catch <unittest -c>` command-line option to unittest,
20822088
along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide
20832089
more friendly handling of control-C during a test run. With catch break
@@ -2103,7 +2109,6 @@ handling functionality within test frameworks.
21032109
(usually in response to the user pressing control-c) all registered results
21042110
have :meth:`~TestResult.stop` called.
21052111

2106-
.. versionadded:: 3.2
21072112

21082113
.. function:: registerResult(result)
21092114

@@ -2115,15 +2120,13 @@ handling functionality within test frameworks.
21152120
handling is not enabled, so test frameworks can unconditionally register
21162121
all results they create independently of whether or not handling is enabled.
21172122

2118-
.. versionadded:: 3.2
21192123

21202124
.. function:: removeResult(result)
21212125

21222126
Remove a registered result. Once a result has been removed then
21232127
:meth:`~TestResult.stop` will no longer be called on that result object in
21242128
response to a control-c.
21252129

2126-
.. versionadded:: 3.2
21272130

21282131
.. function:: removeHandler(function=None)
21292132

@@ -2134,6 +2137,3 @@ handling functionality within test frameworks.
21342137
@unittest.removeHandler
21352138
def test_signal_handling(self):
21362139
...
2137-
2138-
.. versionadded:: 3.2
2139-

0 commit comments

Comments
 (0)