@@ -506,7 +506,8 @@ The :mod:`!test.support` module defines the following functions:
506506
507507.. function :: with_pymalloc()
508508
509- Return :const: `_testcapi.WITH_PYMALLOC `.
509+ Return ``True `` if Python was built with :ref: `pymalloc <pymalloc >` enabled
510+ and is not a :term: `free-threaded build `.
510511
511512
512513.. function :: requires(resource, msg=None)
@@ -1088,7 +1089,7 @@ The :mod:`!test.support` module defines the following functions:
10881089
10891090.. function :: skip_if_broken_multiprocessing_synchronize()
10901091
1091- Skip tests if the :mod: `multiprocessing.synchronize ` module is missing, if
1092+ Skip tests if the :mod: `! multiprocessing.synchronize ` module is missing, if
10921093 there is no available semaphore implementation, or if creating a lock raises
10931094 an :exc: `OSError `.
10941095
@@ -1260,7 +1261,7 @@ script execution tests.
12601261 doesn't have an obvious home with Python's current home finding logic.
12611262
12621263 Setting :envvar: `PYTHONHOME ` is one way to get most of the testsuite to run
1263- in that situation. :envvar: `PYTHONPATH ` or :envvar: `PYTHONUSERSITE ` are
1264+ in that situation. :envvar: `PYTHONPATH ` or :envvar: `PYTHONNOUSERSITE ` are
12641265 other common environment variables that might impact whether or not the
12651266 interpreter can start.
12661267
@@ -1708,8 +1709,8 @@ The :mod:`!test.support.import_helper` module provides support for import tests.
17081709
17091710 This function imports and returns a fresh copy of the named Python module
17101711 by removing the named module from ``sys.modules `` before doing the import.
1711- Note that unlike :func: `reload `, the original module is not affected by
1712- this operation.
1712+ Note that unlike :func: `importlib. reload `, the original module is not
1713+ affected by this operation.
17131714
17141715 *fresh * is an iterable of additional module names that are also removed
17151716 from the ``sys.modules `` cache before doing the import.
@@ -1871,17 +1872,10 @@ The :mod:`!test.support.warnings_helper` module provides support for warnings te
18711872
18721873 In this case all warnings are caught and no errors are raised.
18731874
1874- On entry to the context manager, a :class: `WarningRecorder ` instance is
1875- returned. The underlying warnings list from
1876- :func: `~warnings.catch_warnings ` is available via the recorder object's
1877- :attr: `warnings ` attribute. As a convenience, the attributes of the object
1878- representing the most recent warning can also be accessed directly through
1879- the recorder object (see example below). If no warning has been raised,
1880- then any of the attributes that would otherwise be expected on an object
1881- representing a warning will return ``None ``.
1882-
1883- The recorder object also has a :meth: `reset ` method, which clears the
1884- warnings list.
1875+ On entry to the context manager, a :class: `WarningsRecorder ` instance is
1876+ returned. The recorded warnings are available via its
1877+ :attr: `~WarningsRecorder.warnings ` attribute, and its
1878+ :meth: `~WarningsRecorder.reset ` method discards previously recorded warnings.
18851879
18861880 The context manager is designed to be used like this::
18871881
@@ -1898,11 +1892,11 @@ The :mod:`!test.support.warnings_helper` module provides support for warnings te
18981892
18991893 with check_warnings(quiet=True) as w:
19001894 warnings.warn("foo")
1901- assert str(w.args[0] ) == "foo"
1895+ assert str(w.message ) == "foo"
19021896 warnings.warn("bar")
1903- assert str(w.args[0] ) == "bar"
1904- assert str(w.warnings[0].args[0] ) == "foo"
1905- assert str(w.warnings[1].args[0] ) == "bar"
1897+ assert str(w.message ) == "bar"
1898+ assert str(w.warnings[0].message ) == "foo"
1899+ assert str(w.warnings[1].message ) == "bar"
19061900 w.reset()
19071901 assert len(w.warnings) == 0
19081902
@@ -1914,7 +1908,22 @@ The :mod:`!test.support.warnings_helper` module provides support for warnings te
19141908 New optional arguments *filters * and *quiet *.
19151909
19161910
1917- .. class :: WarningsRecorder()
1911+ .. class :: WarningsRecorder(warnings_list)
1912+
1913+ Class used to record warnings for unit tests. Wraps the warnings list
1914+ returned by :func: `warnings.catch_warnings ` when recording is enabled.
1915+ :func: `check_warnings ` returns an instance of this class.
1916+
1917+ As a convenience, the attributes of the object representing the most recent
1918+ warning can also be accessed directly through the recorder object.
1919+ If no warning has been raised since the recorder was created or last reset,
1920+ these attributes return ``None ``.
1921+
1922+ .. attribute :: warnings
1923+
1924+ A list of warnings recorded since the recorder was created or last reset.
1925+
1926+ .. method :: reset()
19181927
1919- Class used to record warnings for unit tests. See documentation of
1920- :func: ` check_warnings ` above for more details .
1928+ Discard previously recorded warnings from the recorder's view.
1929+ The underlying warnings list is not modified .
0 commit comments