[Python-checkins] bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394)

vstinner webhook-mailer at python.org
Thu May 27 06:55:59 EDT 2021


https://github.com/python/cpython/commit/8cec740820fc875117bfa7b6bdb10202ebeb8fd5
commit: 8cec740820fc875117bfa7b6bdb10202ebeb8fd5
branch: main
author: Erlend Egeberg Aasland <erlend.aasland at innova.no>
committer: vstinner <vstinner at python.org>
date: 2021-05-27T12:55:38+02:00
summary:

bpo-43988: Document test.support.check_disallow_instantiation() (GH-26394)

files:
M Doc/library/test.rst
M Lib/test/support/__init__.py

diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index e4f779bd83eb8..eb4f04f96e4f1 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -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
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 42ca614dce1ad..34a9459b518fa 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -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__



More information about the Python-checkins mailing list