pytest-memray API¶
Types¶
- class pytest_memray.LeaksFilterFunction¶
Bases:
Protocol
A callable that can decide whether to ignore some memory leaks.
This can be used to suppress leak reports from locations that are known to leak. For instance, you might know that objects of a certain type are cached by the code you’re invoking, and so you might want to ignore all reports of leaked memory allocated below that type’s constructor.
You can provide any callable with the following signature as the
filter_fn
keyword argument for thelimit_leaks
marker:
- class pytest_memray.Stack¶
The call stack that led to some memory allocation.
You can inspect the frames which make up the call stack.
- frames: Tuple[StackFrame, ...]¶
The frames that make up the call stack, most recent first.
- class pytest_memray.StackFrame¶
One frame of a call stack.
Each frame has attributes to tell you what code was executing.