(self)
| 1540 | 'requires sys.gettotalrefcount()') |
| 1541 | class TestLeaks(unittest.TestCase): |
| 1542 | def test_create_read(self): |
| 1543 | delta = 0 |
| 1544 | lastrc = sys.gettotalrefcount() |
| 1545 | for i in range(20): |
| 1546 | gc.collect() |
| 1547 | self.assertEqual(gc.garbage, []) |
| 1548 | rc = sys.gettotalrefcount() |
| 1549 | csv.reader(["a,b,c\r\n"]) |
| 1550 | csv.reader(["a,b,c\r\n"]) |
| 1551 | csv.reader(["a,b,c\r\n"]) |
| 1552 | delta = rc-lastrc |
| 1553 | lastrc = rc |
| 1554 | # if csv.reader() leaks, last delta should be 3 or more |
| 1555 | self.assertLess(delta, 3) |
| 1556 | |
| 1557 | def test_create_write(self): |
| 1558 | delta = 0 |
nothing calls this directly
no test coverage detected