gh-70441: Fix test_tarfile on systems w/o bz2 (gh-2962) (#94258)

This commit is contained in:
Christian Heimes 2022-06-25 12:53:37 +02:00 committed by GitHub
parent 50cd4b6959
commit b528499052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -1613,6 +1613,7 @@ class CompressLevelRaises(unittest.TestCase):
with self.assertRaises(TypeError):
tarfile.open(tmpname, "w:", fobj, compresslevel=compresslevel)
@support.requires_bz2()
def test_wrong_compresslevels(self):
# BZ2 checks that the compresslevel is in [1,9]. gz does not
fobj = io.BytesIO()