-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker for fail a leaking test #45
Comments
Any reason the https://pytest-memray.readthedocs.io/en/latest/usage.html#limit-memory does not help? |
@gaborbernat thanks for the link. Is there a way to set a default limit for all tests (without the need for adding this to all tests manually) - something like a memory base fence ...? |
There is not at the moment, but PR welcome. And you can also set it to your project via a pytest hook. |
Do you have a link to an example for this as well ? :-) |
You can use any of those hooks: https://docs.pytest.org/en/7.1.x/reference/reference.html But I would personally recommend using an autouse fixture instead: https://docs.pytest.org/en/6.2.x/fixture.html#autouse-fixtures-fixtures-you-don-t-have-to-request |
I'm adding a new marker in #52 for checking memory leaks. Please @tonybaloney check if this would work for your use case. |
Feature Request
I've got some scripts using memray that run some critical code 100,000 times, I use this in the following way:
Then I manually look at the HTML report for leaky lines and raise bugs against them. Is there any way to automate this using this pytest package?
The test script is just something like:
The text was updated successfully, but these errors were encountered: