MCPcopy Index your code
hub / github.com/python/cpython / test_write

Method test_write

Lib/test/test_csv.py:1589–1604  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
1606class TestUnicode(unittest.TestCase):
1607

Callers

nothing calls this directly

Calls 6

NULClass · 0.85
writerowMethod · 0.80
collectMethod · 0.45
assertEqualMethod · 0.45
writerMethod · 0.45
assertLessMethod · 0.45

Tested by

no test coverage detected