From eb76319aafb86439a1cbce8d55f2f353e0f11457 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 6 Aug 2026 18:09:22 +0300 Subject: [PATCH] gh-75876: Use functools.wraps() in test.support test decorators (GH-155262) 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 c3aefdb9eff0734058376b96fc86d89b1a345d75) Co-authored-by: Claude Opus 5 (1M context) --- Lib/test/support/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 6d8a1e786a4b5f7..91bc7bfd226fee9 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1181,6 +1181,7 @@ def bigmemtest(size, memuse, dry_run=True): test doesn't support dummy runs when -M is not specified. """ def decorator(f): + @functools.wraps(f) def wrapper(self): size = wrapper.size memuse = wrapper.memuse @@ -1233,6 +1234,7 @@ def internal(*args, **kwargs): def bigaddrspacetest(f): """Decorator for tests that fill the address space.""" + @functools.wraps(f) def wrapper(self): if max_memuse < MAX_Py_ssize_t: if MAX_Py_ssize_t >= 2**63 - 1 and max_memuse >= 2**31: