(self)
| 1587 | self.assertLess(delta, 5) |
| 1588 | |
| 1589 | def test_write(self): |
| 1590 | delta = 0 |
| 1591 | rows = [[1,2,3]]*5 |
| 1592 | s = NUL() |
| 1593 | lastrc = sys.gettotalrefcount() |
| 1594 | for i in range(20): |
| 1595 | gc.collect() |
| 1596 | self.assertEqual(gc.garbage, []) |
| 1597 | rc = sys.gettotalrefcount() |
| 1598 | writer = csv.writer(s) |
| 1599 | for row in rows: |
| 1600 | writer.writerow(row) |
| 1601 | delta = rc-lastrc |
| 1602 | lastrc = rc |
| 1603 | # if writer leaks during write, last delta should be 5 or more |
| 1604 | self.assertLess(delta, 5) |
| 1605 | |
| 1606 | class TestUnicode(unittest.TestCase): |
| 1607 |
nothing calls this directly
no test coverage detected