(self)
| 1388 | # in all possible mode combinations. |
| 1389 | |
| 1390 | def test_fileobj_no_close(self): |
| 1391 | fobj = io.BytesIO() |
| 1392 | with tarfile.open(fileobj=fobj, mode=self.mode) as tar: |
| 1393 | tar.addfile(tarfile.TarInfo("foo")) |
| 1394 | self.assertFalse(fobj.closed, "external fileobjs must never closed") |
| 1395 | # Issue #20238: Incomplete gzip output with mode="w:gz" |
| 1396 | data = fobj.getvalue() |
| 1397 | del tar |
| 1398 | support.gc_collect() |
| 1399 | self.assertFalse(fobj.closed) |
| 1400 | self.assertEqual(data, fobj.getvalue()) |
| 1401 | |
| 1402 | def test_eof_marker(self): |
| 1403 | # Make sure an end of archive marker is written (two zero blocks). |
nothing calls this directly
no test coverage detected