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

Method test_del_unrolled_file

Lib/test/test_tempfile.py:1252–1259  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1250 os.rmdir(dir)
1251
1252 def test_del_unrolled_file(self):
1253 # The unrolled SpooledTemporaryFile should raise a ResourceWarning
1254 # when deleted since the file was not explicitly closed.
1255 f = self.do_create(max_size=10)
1256 f.write(b'foo')
1257 self.assertEqual(f.name, None) # Unrolled so no filename/fd
1258 with self.assertWarns(ResourceWarning):
1259 f.__del__()
1260
1261 def test_del_rolled_file(self):
1262 # The rolled file should be deleted when the SpooledTemporaryFile

Callers

nothing calls this directly

Calls 5

do_createMethod · 0.95
assertWarnsMethod · 0.80
writeMethod · 0.45
assertEqualMethod · 0.45
__del__Method · 0.45

Tested by

no test coverage detected