]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Thu, 27 May 2021 10:55:38 +0000 (12:55 +0200)
committerGitHub <noreply@github.com>
Thu, 27 May 2021 10:55:38 +0000 (12:55 +0200)
Doc/library/test.rst
Lib/test/support/__init__.py

index e4f779bd83eb87087fbf99b4d56a479678b0d07e..eb4f04f96e4f18e1e6bbd492964816f0c1d9f0f3 100644 (file)
@@ -928,8 +928,16 @@ The :mod:`test.support` module defines the following functions:
    .. versionadded:: 3.10
 
 
+.. function:: check_disallow_instantiation(test_case, tp, *args, **kwds)
+
+   Assert that type *tp* cannot be instantiated using *args* and *kwds*.
+
+   .. versionadded:: 3.11
+
+
 The :mod:`test.support` module defines the following classes:
 
+
 .. class:: SuppressCrashReport()
 
    A context manager used to try to prevent crash dialog popups on tests that
index 42ca614dce1ad16b775f6d2982c59e27104eadd4..34a9459b518fabd4e522a56b8b2912b6b150fd42 100644 (file)
@@ -1987,9 +1987,9 @@ def skip_if_broken_multiprocessing_synchronize():
 
 def check_disallow_instantiation(testcase, tp, *args, **kwds):
     """
-    Helper for testing types with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag.
+    Check that given type cannot be instantiated using *args and **kwds.
 
-    See bpo-43916.
+    See bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag.
     """
     mod = tp.__module__
     name = tp.__name__