MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_write

Method test_write

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected