@@ -1496,6 +1496,7 @@ def test_misbehaved_io_read(self):
1496
1496
def test_garbage_collection (self ):
1497
1497
# C BufferedReader objects are collected.
1498
1498
# The Python version has __del__, so it ends into gc.garbage instead
1499
+ self .addCleanup (support .unlink , support .TESTFN )
1499
1500
with support .check_warnings (('' , ResourceWarning )):
1500
1501
rawio = self .FileIO (support .TESTFN , "w+b" )
1501
1502
f = self .tp (rawio )
@@ -1698,6 +1699,7 @@ def test_destructor(self):
1698
1699
1699
1700
def test_truncate (self ):
1700
1701
# Truncate implicitly flushes the buffer.
1702
+ self .addCleanup (support .unlink , support .TESTFN )
1701
1703
with self .open (support .TESTFN , self .write_mode , buffering = 0 ) as raw :
1702
1704
bufio = self .tp (raw , 8 )
1703
1705
bufio .write (b"abcdef" )
@@ -1710,6 +1712,7 @@ def test_truncate_after_write(self):
1710
1712
# Ensure that truncate preserves the file position after
1711
1713
# writes longer than the buffer size.
1712
1714
# Issue: https://bugs.python.org/issue32228
1715
+ self .addCleanup (support .unlink , support .TESTFN )
1713
1716
with self .open (support .TESTFN , "wb" ) as f :
1714
1717
# Fill with some buffer
1715
1718
f .write (b'\x00 ' * 10000 )
@@ -1820,6 +1823,7 @@ def test_garbage_collection(self):
1820
1823
# C BufferedWriter objects are collected, and collecting them flushes
1821
1824
# all data to disk.
1822
1825
# The Python version has __del__, so it ends into gc.garbage instead
1826
+ self .addCleanup (support .unlink , support .TESTFN )
1823
1827
with support .check_warnings (('' , ResourceWarning )):
1824
1828
rawio = self .FileIO (support .TESTFN , "w+b" )
1825
1829
f = self .tp (rawio )
0 commit comments