Skip to content
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

Add a new current_thread_only to all markers #117

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

pablogsal
Copy link
Member

Add a new "current_thread_only" keyword to the "limit_memory" and "limit_leaks" markers to ignore all allocations made in threads other than the one running the test.

Closes: #111

Add a new "current_thread_only" keyword to the "limit_memory" and
"limit_leaks" markers to ignore all allocations made in threads other
than the one running the test.
godlygeek
godlygeek previously approved these changes Apr 17, 2024
Copy link
Contributor

@godlygeek godlygeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though I've pushed a fixup to correct an omission in the docs, and I'd suggest a simplification to the implementation:

src/pytest_memray/marks.py Outdated Show resolved Hide resolved
src/pytest_memray/marks.py Outdated Show resolved Hide resolved
@pablogsal pablogsal enabled auto-merge (squash) April 18, 2024 12:14
@pablogsal pablogsal disabled auto-merge April 18, 2024 12:15
@pablogsal pablogsal merged commit 2f05466 into bloomberg:main Apr 18, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option to count only memory used in current thread / limit_memory("10MB", current_thread_only=True),
2 participants