@@ -507,7 +507,8 @@ The :mod:`!test.support` module defines the following functions:
507507
508508.. function :: with_pymalloc()
509509
510- Return :const: `_testcapi.WITH_PYMALLOC `.
510+ Return ``True `` if Python was built with :ref: `pymalloc <pymalloc >` enabled
511+ and is not a :term: `free-threaded build `.
511512
512513
513514.. function :: requires(resource, msg=None)
@@ -1089,7 +1090,7 @@ The :mod:`!test.support` module defines the following functions:
10891090
10901091.. function :: skip_if_broken_multiprocessing_synchronize()
10911092
1092- Skip tests if the :mod: `multiprocessing.synchronize ` module is missing, if
1093+ Skip tests if the :mod: `! multiprocessing.synchronize ` module is missing, if
10931094 there is no available semaphore implementation, or if creating a lock raises
10941095 an :exc: `OSError `.
10951096
@@ -1261,7 +1262,7 @@ script execution tests.
12611262 doesn't have an obvious home with Python's current home finding logic.
12621263
12631264 Setting :envvar: `PYTHONHOME ` is one way to get most of the testsuite to run
1264- in that situation. :envvar: `PYTHONPATH ` or :envvar: `PYTHONUSERSITE ` are
1265+ in that situation. :envvar: `PYTHONPATH ` or :envvar: `PYTHONNOUSERSITE ` are
12651266 other common environment variables that might impact whether or not the
12661267 interpreter can start.
12671268
@@ -1683,8 +1684,8 @@ The :mod:`!test.support.import_helper` module provides support for import tests.
16831684
16841685 This function imports and returns a fresh copy of the named Python module
16851686 by removing the named module from ``sys.modules `` before doing the import.
1686- Note that unlike :func: `reload `, the original module is not affected by
1687- this operation.
1687+ Note that unlike :func: `importlib. reload `, the original module is not
1688+ affected by this operation.
16881689
16891690 *fresh * is an iterable of additional module names that are also removed
16901691 from the ``sys.modules `` cache before doing the import.
@@ -1846,17 +1847,10 @@ The :mod:`!test.support.warnings_helper` module provides support for warnings te
18461847
18471848 In this case all warnings are caught and no errors are raised.
18481849
1849- On entry to the context manager, a :class: `WarningRecorder ` instance is
1850- returned. The underlying warnings list from
1851- :func: `~warnings.catch_warnings ` is available via the recorder object's
1852- :attr: `warnings ` attribute. As a convenience, the attributes of the object
1853- representing the most recent warning can also be accessed directly through
1854- the recorder object (see example below). If no warning has been raised,
1855- then any of the attributes that would otherwise be expected on an object
1856- representing a warning will return ``None ``.
1857-
1858- The recorder object also has a :meth: `reset ` method, which clears the
1859- warnings list.
1850+ On entry to the context manager, a :class: `WarningsRecorder ` instance is
1851+ returned. The recorded warnings are available via its
1852+ :attr: `~WarningsRecorder.warnings ` attribute, and its
1853+ :meth: `~WarningsRecorder.reset ` method discards previously recorded warnings.
18601854
18611855 The context manager is designed to be used like this::
18621856
@@ -1873,11 +1867,11 @@ The :mod:`!test.support.warnings_helper` module provides support for warnings te
18731867
18741868 with check_warnings(quiet=True) as w:
18751869 warnings.warn("foo")
1876- assert str(w.args[0] ) == "foo"
1870+ assert str(w.message ) == "foo"
18771871 warnings.warn("bar")
1878- assert str(w.args[0] ) == "bar"
1879- assert str(w.warnings[0].args[0] ) == "foo"
1880- assert str(w.warnings[1].args[0] ) == "bar"
1872+ assert str(w.message ) == "bar"
1873+ assert str(w.warnings[0].message ) == "foo"
1874+ assert str(w.warnings[1].message ) == "bar"
18811875 w.reset()
18821876 assert len(w.warnings) == 0
18831877
@@ -1889,7 +1883,22 @@ The :mod:`!test.support.warnings_helper` module provides support for warnings te
18891883 New optional arguments *filters * and *quiet *.
18901884
18911885
1892- .. class :: WarningsRecorder()
1886+ .. class :: WarningsRecorder(warnings_list)
1887+
1888+ Class used to record warnings for unit tests. Wraps the warnings list
1889+ returned by :func: `warnings.catch_warnings ` when recording is enabled.
1890+ :func: `check_warnings ` returns an instance of this class.
1891+
1892+ As a convenience, the attributes of the object representing the most recent
1893+ warning can also be accessed directly through the recorder object.
1894+ If no warning has been raised since the recorder was created or last reset,
1895+ these attributes return ``None ``.
1896+
1897+ .. attribute :: warnings
1898+
1899+ A list of warnings recorded since the recorder was created or last reset.
1900+
1901+ .. method :: reset()
18931902
1894- Class used to record warnings for unit tests. See documentation of
1895- :func: ` check_warnings ` above for more details .
1903+ Discard previously recorded warnings from the recorder's view.
1904+ The underlying warnings list is not modified .
0 commit comments