Commit 2a3d7d1a authored by Serhiy Storchaka's avatar Serhiy Storchaka

Test the open of non-exitent tarfile in all modes.

parent 6cbc5f78
......@@ -232,6 +232,12 @@ class CommonReadTest(ReadTest):
finally:
tar.close()
def test_non_existent_tarfile(self):
# Test for issue11513: prevent non-existent gzipped tarfiles raising
# multiple exceptions.
with self.assertRaisesRegex(FileNotFoundError, "xxx"):
tarfile.open("xxx", self.mode)
def test_null_tarfile(self):
# Test for issue6123: Allow opening empty archives.
# This test guarantees that tarfile.open() does not treat an empty
......@@ -444,11 +450,7 @@ class MiscReadTest(MiscReadTestBase, unittest.TestCase):
test_fail_comp = None
class GzipMiscReadTest(GzipTest, MiscReadTestBase, unittest.TestCase):
def test_non_existent_targz_file(self):
# Test for issue11513: prevent non-existent gzipped tarfiles raising
# multiple exceptions.
with self.assertRaisesRegex(FileNotFoundError, "xxx"):
tarfile.open("xxx", self.mode)
pass
class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase):
def test_no_name_argument(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment