| 20 | @pytest.mark.skipif(not has_referrers or IS_PYPY, reason="gc.get_referrers not implemented") |
| 21 | class Test(unittest.TestCase): |
| 22 | def test_get_referrers1(self): |
| 23 | container = [] |
| 24 | contained = [1, 2] |
| 25 | container.append(0) |
| 26 | container.append(contained) |
| 27 | |
| 28 | # Ok, we have the contained in this frame and inside the given list (which on turn is in this frame too). |
| 29 | # we should skip temporary references inside the get_referrer_info. |
| 30 | result = pydevd_referrers.get_referrer_info(contained) |
| 31 | assert "list[1]" in result |
| 32 | pydevd_referrers.print_referrers(contained, stream=StringIO()) |
| 33 | |
| 34 | def test_get_referrers2(self): |
| 35 | class MyClass(object): |