bloomberg / pytest-memray

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

Support --follow-fork #89

Open luochen1990 opened 12 months ago

luochen1990 commented 12 months ago

Feature Request

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

I'm running a test case via a subprocess, and I find that memray provided a CLI argument for this case, but there is no corresponding argument for pytest-memray

Describe the solution you'd like

Hoping that there is also a CLI argument like --memray-follow-fork to do similar thing.

Describe alternatives you've considered

Maybe add a keyword argument to the mark limit_memory is also great.

@pytest.mark.limit_memory("60 KB", follow_fork = True)
pablogsal commented 11 months ago

The problem with this option is that memray creates different result dumps for every forked process and expects the user to analyse every one separately. This feature will also require the plugin to change the reporting structure to report the allocations per process, which requires more work and design than just exposing the flag.