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