@@ -60,9 +60,7 @@ def compare_element(result, expected, typ, version=None):
60
60
assert result == expected
61
61
assert result .freq == expected .freq
62
62
else :
63
- comparator = getattr (
64
- tm , "assert_{typ}_equal" .format (typ = typ ), tm .assert_almost_equal
65
- )
63
+ comparator = getattr (tm , f"assert_{ typ } _equal" , tm .assert_almost_equal )
66
64
comparator (result , expected )
67
65
68
66
@@ -77,7 +75,7 @@ def compare(data, vf, version):
77
75
78
76
# use a specific comparator
79
77
# if available
80
- comparator = "compare_{typ}_{dt}" . format ( typ = typ , dt = dt )
78
+ comparator = f "compare_{ typ } _{ dt } "
81
79
82
80
comparator = m .get (comparator , m ["compare_element" ])
83
81
comparator (result , expected , typ , version )
@@ -234,7 +232,7 @@ def test_legacy_sparse_warning(datapath):
234
232
235
233
@pytest .fixture
236
234
def get_random_path ():
237
- return "__{}__.pickle" . format ( tm .rands (10 ))
235
+ return f "__{ tm .rands (10 )} __.pickle"
238
236
239
237
240
238
class TestCompression :
@@ -262,7 +260,7 @@ def compress_file(self, src_path, dest_path, compression):
262
260
elif compression == "xz" :
263
261
f = _get_lzma_file (lzma )(dest_path , "w" )
264
262
else :
265
- msg = "Unrecognized compression type: {}" . format ( compression )
263
+ msg = f "Unrecognized compression type: { compression } "
266
264
raise ValueError (msg )
267
265
268
266
if compression != "zip" :
0 commit comments