-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new marker to check for memory leaks (#52)
Users have indicated that it will be very useful if the plugin exposes a way to detect memory leaks in tests. This is possible, but is a bit tricky as the interpreter can allocate memory for internal caches, as well as user functions. To make this more reliable, the new marker will take two parameters: * The limit of memory per location to consider an allocation. If the memory leaked by any allocation location in the test is higher than this value, the test will fail. * An optional callable function that can be used to filter out locations. This will allow users to remove false positives. Signed-off-by: Pablo Galindo <[email protected]> Signed-off-by: Matt Wozniski <[email protected]> Co-authored-by: Matt Wozniski <[email protected]>
- Loading branch information
Showing
9 changed files
with
497 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. module:: pytest_memray | ||
|
||
pytest-memray API | ||
================= | ||
|
||
Types | ||
----- | ||
|
||
.. autoclass:: LeaksFilterFunction() | ||
:members: __call__ | ||
:show-inheritance: | ||
|
||
.. autoclass:: Stack() | ||
:members: | ||
|
||
.. autoclass:: StackFrame() | ||
:members: | ||
|
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -13,4 +13,5 @@ reports like: | |
|
||
usage | ||
configuration | ||
api | ||
news |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
from __future__ import annotations | ||
|
||
from ._version import __version__ as __version__ | ||
from .marks import LeaksFilterFunction | ||
from .marks import Stack | ||
from .marks import StackFrame | ||
|
||
__all__ = [ | ||
"__version__", | ||
"LeaksFilterFunction", | ||
"Stack", | ||
"StackFrame", | ||
] |
Oops, something went wrong.