Skip to content

Commit 8582fe1

Browse files
[3.13] gh-75876: Use functools.wraps() in test.support test decorators (GH-155262) (GH-155311)
bigmemtest() and bigaddrspacetest() returned a wrapper named "wrapper", so a decorator applied on top of them could not identify the test. (cherry picked from commit c3aefdb) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c80eacd commit 8582fe1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/test/support/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ def bigmemtest(size, memuse, dry_run=True):
11811181
test doesn't support dummy runs when -M is not specified.
11821182
"""
11831183
def decorator(f):
1184+
@functools.wraps(f)
11841185
def wrapper(self):
11851186
size = wrapper.size
11861187
memuse = wrapper.memuse
@@ -1233,6 +1234,7 @@ def internal(*args, **kwargs):
12331234

12341235
def bigaddrspacetest(f):
12351236
"""Decorator for tests that fill the address space."""
1237+
@functools.wraps(f)
12361238
def wrapper(self):
12371239
if max_memuse < MAX_Py_ssize_t:
12381240
if MAX_Py_ssize_t >= 2**63 - 1 and max_memuse >= 2**31:

0 commit comments

Comments
 (0)