FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-75876: Use functools.wraps() in test.support test decorators (GH-155262) by miss-islington · Pull Request #155291 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 3 additions & 0 deletions Lib/test/support/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,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
Expand Down Expand Up @@ -1245,6 +1246,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:
Expand Down Expand Up @@ -1350,6 +1352,7 @@ def no_rerun(reason):
def deco(func):
assert not isinstance(func, type), func
_has_run = False
@functools.wraps(func)
def wrapper(self):
nonlocal _has_run
if _has_run:
Expand Down
Loading

Back | FazBrowse Home | New Git URL