summaryrefslogtreecommitdiff
path: root/tests/test_wheelfile.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2021-12-22 16:30:41 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2021-12-22 16:30:41 +0200
commitfa4de8bd7dce1611be217ade3aade0bd8c76ca7a (patch)
tree621e55e88d3861bea1dc2c42ea0eae87b5930b89 /tests/test_wheelfile.py
parent45af6b0f420b7a90af417b3846b0bdfe1c6a70d4 (diff)
downloadwheel-git-fa4de8bd7dce1611be217ade3aade0bd8c76ca7a.tar.gz
Upgraded to py3.7+ syntax
Diffstat (limited to 'tests/test_wheelfile.py')
-rw-r--r--tests/test_wheelfile.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_wheelfile.py b/tests/test_wheelfile.py
index 0e060b1..f6e6125 100644
--- a/tests/test_wheelfile.py
+++ b/tests/test_wheelfile.py
@@ -29,7 +29,7 @@ def test_wheelfile_re(tmpdir):
])
def test_bad_wheel_filename(filename):
exc = pytest.raises(WheelError, WheelFile, filename)
- exc.match('^Bad wheel filename {!r}$'.format(filename))
+ exc.match(f'^Bad wheel filename {filename!r}$')
def test_missing_record(wheel_path):
@@ -56,14 +56,14 @@ def test_unsupported_hash_algorithm(wheel_path):
('sha1', 'QjCnGu5Qucb6-vir1a6BVptvOA4')
], ids=['md5', 'sha1'])
def test_weak_hash_algorithm(wheel_path, algorithm, digest):
- hash_string = '{}={}'.format(algorithm, digest)
+ hash_string = f'{algorithm}={digest}'
with ZipFile(wheel_path, 'w') as zf:
zf.writestr(native('hello/héllö.py'), as_bytes('print("Héllö, w0rld!")\n'))
zf.writestr('test-1.0.dist-info/RECORD',
- as_bytes('hello/héllö.py,{},25'.format(hash_string)))
+ as_bytes(f'hello/héllö.py,{hash_string},25'))
exc = pytest.raises(WheelError, WheelFile, wheel_path)
- exc.match(r"^Weak hash algorithm \({}\) is not permitted by PEP 427$".format(algorithm))
+ exc.match(fr"^Weak hash algorithm \({algorithm}\) is not permitted by PEP 427$")
@pytest.mark.parametrize('algorithm, digest', [
@@ -73,11 +73,11 @@ def test_weak_hash_algorithm(wheel_path, algorithm, digest):
'iLNpWVxTwuDWqBQ')
], ids=['sha256', 'sha384', 'sha512'])
def test_testzip(wheel_path, algorithm, digest):
- hash_string = '{}={}'.format(algorithm, digest)
+ hash_string = f'{algorithm}={digest}'
with ZipFile(wheel_path, 'w') as zf:
zf.writestr(native('hello/héllö.py'), as_bytes('print("Héllö, world!")\n'))
zf.writestr('test-1.0.dist-info/RECORD',
- as_bytes('hello/héllö.py,{},25'.format(hash_string)))
+ as_bytes(f'hello/héllö.py,{hash_string},25'))
with WheelFile(wheel_path) as wf:
wf.testzip()