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

incompatible with flaky (as used in urllib3) #53

Closed graingert closed 1 year ago

graingert commented 1 year ago

Bug Report

Current Behavior if pytest-flaky re-runs a test it fails with FAILED test/test_demo.py::test_demo - RuntimeError: No more than one Tracker instance can be active at the same time

Input Code

import itertools

import pytest

count = itertools.count().__next__

@pytest.mark.flaky
def test_demo():
    if count() <= 0:
        assert False

Expected behavior/code

Environment

Possible Solution

Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

pablogsal commented 1 year ago

This has been fixed in https://github.com/bloomberg/pytest-memray/pull/50

I noticed the problem when I was debugging the segfault in urllib3

pablogsal commented 1 year ago

Will be available in the next release

pablogsal commented 1 year ago

Thanks for the report @graingert !