(self)
| 1551 | self.assertLess(delta, 5) |
| 1552 | |
| 1553 | def test_write(self): |
| 1554 | delta = 0 |
| 1555 | rows = [[1,2,3]]*5 |
| 1556 | s = NUL() |
| 1557 | lastrc = sys.gettotalrefcount() |
| 1558 | for i in range(20): |
| 1559 | gc.collect() |
| 1560 | self.assertEqual(gc.garbage, []) |
| 1561 | rc = sys.gettotalrefcount() |
| 1562 | writer = csv.writer(s) |
| 1563 | for row in rows: |
| 1564 | writer.writerow(row) |
| 1565 | delta = rc-lastrc |
| 1566 | lastrc = rc |
| 1567 | # if writer leaks during write, last delta should be 5 or more |
| 1568 | self.assertLess(delta, 5) |
| 1569 | |
| 1570 | class TestUnicode(unittest.TestCase): |
| 1571 |
nothing calls this directly
no test coverage detected