bloomberg / pytest-memray

pytest plugin for easy integration of memray memory profiler
https://pytest-memray.readthedocs.io/en/latest/
Apache License 2.0
335 stars 24 forks source link

Enable @pytest.mark.limit_memory without having to specify --memray #49

Closed pquentin closed 1 year ago

pquentin commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe.

I tried to use pytest.mark.limit_memory in a urllib3 test and was confused because pytest was not finding it because I only skimmed the README and missed the --memray option.

(Additionally I was surprised that limit_memory was not in the pytest-memray README at all. I only found about it on the memray README.)

Describe the solution you'd like

I'd like to be able to use pytest.mark.limit_memory without passing --memray and without showing the memray report at the end.

Describe alternatives you've considered

The alternative is the status quo. memray is incredibly useful, this is only a small quality-of-life improvement.

Teachability, Documentation, Adoption, Migration Strategy

If we had a code snipped for limit_memory in the docs, users could simply copy/paste it without having to find out about --memray.

pquentin commented 1 year ago

Having hit https://github.com/bloomberg/memray/issues/249, I would appreciate having a way to disable memray though.

pablogsal commented 1 year ago

I think this makes sense. Will make a PR soon after the ones we have in review now land as it will require some test modifications. :)