summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gzip.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-22 10:42:50 (GMT)
committerGitHub <noreply@github.com>2025-05-22 10:42:50 (GMT)
commitdb98e0bb127c469842dc119d23e5daacd23862cc (patch)
tree5628e04625c93f2e5bde25aa29dedb3c154a0dec /Lib/test/test_gzip.py
parentd5f7e80d4407655919b32bbd5746b23af174bc5b (diff)
downloadcpython-db98e0bb127c469842dc119d23e5daacd23862cc.zip
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.gz
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.bz2
[3.14] gh-71339: Use new assertion methods in tests (GH-129046) (GH-134498)
(cherry picked from commit 2602d8ae981c4bae1cada2c174b367d97f712efb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r--Lib/test/test_gzip.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index fa5de7c..ccbacc7 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -331,13 +331,13 @@ class TestGzip(BaseTest):
def test_1647484(self):
for mode in ('wb', 'rb'):
with gzip.GzipFile(self.filename, mode) as f:
- self.assertTrue(hasattr(f, "name"))
+ self.assertHasAttr(f, "name")
self.assertEqual(f.name, self.filename)
def test_paddedfile_getattr(self):
self.test_write()
with gzip.GzipFile(self.filename, 'rb') as f:
- self.assertTrue(hasattr(f.fileobj, "name"))
+ self.assertHasAttr(f.fileobj, "name")
self.assertEqual(f.fileobj.name, self.filename)
def test_mtime(self):
@@ -345,7 +345,7 @@ class TestGzip(BaseTest):
with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite:
fWrite.write(data1)
with gzip.GzipFile(self.filename) as fRead:
- self.assertTrue(hasattr(fRead, 'mtime'))
+ self.assertHasAttr(fRead, 'mtime')
self.assertIsNone(fRead.mtime)
dataRead = fRead.read()
self.assertEqual(dataRead, data1)
@@ -460,7 +460,7 @@ class TestGzip(BaseTest):
self.assertEqual(d, data1 * 50, "Incorrect data in file")
def test_gzip_BadGzipFile_exception(self):
- self.assertTrue(issubclass(gzip.BadGzipFile, OSError))
+ self.assertIsSubclass(gzip.BadGzipFile, OSError)
def test_bad_gzip_file(self):
with open(self.filename, 'wb') as file: