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

compare memory usage between pytest runs

Open djarecka opened this issue 2 years ago • 2 comments

Feature Request

Perhaps it will be useful if you can compare if tests are not using more memory after new changes.

djarecka avatar May 02 '22 19:05 djarecka

Thanks! We will consider doing this feature but a workaround today is to check how much memory is using the test and then use the limit marker with the current memory usage. That way if the test is using more memory it will fail.

pablogsal avatar May 02 '22 21:05 pablogsal

feels like this could be implemented using the pytest core cache fixture https://docs.pytest.org/en/6.2.x/cache.html#cache

the reporter can mirror the information it already prints to the terminal and cache it as well. Then print a warning if the test still passes, but uses more memory (even without the limit_memory marker?)

petr-tik avatar May 20 '22 23:05 petr-tik