pytest-memray icon indicating copy to clipboard operation
pytest-memray copied to clipboard

Support --follow-fork

Open luochen1990 opened this issue 2 years ago • 1 comments

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)

luochen1990 avatar Jul 20 '23 10:07 luochen1990

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.

pablogsal avatar Aug 01 '23 13:08 pablogsal