diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 9a271cdb598e80f..eadf83fecdc914d 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -859,6 +859,8 @@ def test_read_through(self): "TarFile.extractfile() failed") if not buf: break + + @unittest.skipIf(zlib is None, "requires zlib") def test_read_with_extra_header(self): with tarfile.open(tgzname_with_comment_extra_data_in_header, mode="r|*") as _: