bpo-43988: Document test.support.check_disallow_instantiation() (GH-2… · python/cpython@8cec740 (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -928,8 +928,16 @@ The :mod:`test.support` module defines the following functions: | ||
928 | 928 | .. versionadded:: 3.10 |
929 | 929 | |
930 | 930 | |
931 | +.. function:: check_disallow_instantiation(test_case, tp, *args, **kwds) | |
932 | + | |
933 | + Assert that type *tp* cannot be instantiated using *args* and *kwds*. | |
934 | + | |
935 | + .. versionadded:: 3.11 | |
936 | + | |
937 | + | |
931 | 938 | The :mod:`test.support` module defines the following classes: |
932 | 939 | |
940 | + | |
933 | 941 | .. class:: SuppressCrashReport() |
934 | 942 | |
935 | 943 | A context manager used to try to prevent crash dialog popups on tests that |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1987,9 +1987,9 @@ def skip_if_broken_multiprocessing_synchronize(): | ||
1987 | 1987 | |
1988 | 1988 | def check_disallow_instantiation(testcase, tp, *args, **kwds): |
1989 | 1989 | """ |
1990 | - Helper for testing types with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag. | |
1990 | + Check that given type cannot be instantiated using *args and **kwds. | |
1991 | 1991 | |
1992 | - See bpo-43916. | |
1992 | + See bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag. | |
1993 | 1993 | """ |
1994 | 1994 | mod = tp.__module__ |
1995 | 1995 | name = tp.__name__ |