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

View file

@ -1613,6 +1613,7 @@ def test_compresslevel_wrong_modes(self):
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()