Skip to content

Commit 0fbe6ce

Browse files
committed
Update test_exceptions from 3.13.5
1 parent e064f8c commit 0fbe6ce

File tree

2 files changed

+511
-631
lines changed

2 files changed

+511
-631
lines changed

Lib/test/support/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,10 @@ def exceeds_recursion_limit():
26172617
'skipped on s390x')
26182618
HAVE_ASAN_FORK_BUG = check_sanitizer(address=True)
26192619

2620+
# From CPython 3.13.5
2621+
Py_TRACE_REFS = hasattr(sys, 'getobjects')
2622+
2623+
26202624
# From Cpython 3.13.5
26212625
@contextlib.contextmanager
26222626
def no_color():
@@ -2641,6 +2645,21 @@ def wrapper(*args, **kwargs):
26412645
return wrapper
26422646

26432647

2648+
# From Cpython 3.13.5
2649+
def force_not_colorized_test_class(cls):
2650+
"""Force the terminal not to be colorized for the entire test class."""
2651+
original_setUpClass = cls.setUpClass
2652+
2653+
@classmethod
2654+
@functools.wraps(cls.setUpClass)
2655+
def new_setUpClass(cls):
2656+
cls.enterClassContext(no_color())
2657+
original_setUpClass()
2658+
2659+
cls.setUpClass = new_setUpClass
2660+
return cls
2661+
2662+
26442663
# From python 3.12.8
26452664
class BrokenIter:
26462665
def __init__(self, init_raises=False, next_raises=False, iter_raises=False):

0 commit comments

Comments
 (0)