pytest-memray
pytest-memray copied to clipboard
Cannot get report for all tests
Bug Report
When I run pytest with memray enabled and --most-allocations=0, I get an error at the end of pytest.
Backtrace
...
File "/code/venv/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/code/venv/lib/python3.8/site-packages/pytest_memray/plugin.py", line 195, in pytest_terminal_summary
for test_id, total_size in total_sizes.most_common(max_results):
File "/usr/local/lib/python3.8/collections/__init__.py", line 570, in most_common
return _heapq.nlargest(n, self.items(), key=_itemgetter(1))
File "/usr/local/lib/python3.8/heapq.py", line 540, in nlargest
if n >= size:
TypeError: '>=' not supported between instances of 'str' and 'int'
Expected behavior/code I expected to see allocation reports for all tests.
Environment
- Python(s): python3.8
Possible Solution
Oh, interesting. Could you give us a link to your project or the tests you are running so we can try to reproduce it?
I'm closing this issue as we don't have a reproducer. Please, feel free to reopen if you manage to get a simple example we can run to check the error.
This is also a problem for me. @pablogsal