Skip to content

Commit 050ba59

Browse files
AncientRicklesjreback
authored andcommitted
Fixing pandas/tests/indexes/multi/test_analytics.py to utilize python… (#30418)
1 parent 0ea0fdd commit 050ba59

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/indexes/multi/test_analytics.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def test_map(idx):
277277
def test_map_dictlike(idx, mapper):
278278

279279
if isinstance(idx, (pd.CategoricalIndex, pd.IntervalIndex)):
280-
pytest.skip("skipping tests for {}".format(type(idx)))
280+
pytest.skip(f"skipping tests for {type(idx)}")
281281

282282
identity = mapper(idx.values, idx)
283283

@@ -330,13 +330,13 @@ def test_numpy_ufuncs(idx, func):
330330

331331
if _np_version_under1p17:
332332
expected_exception = AttributeError
333-
msg = "'tuple' object has no attribute '{}'".format(func.__name__)
333+
msg = f"'tuple' object has no attribute '{func.__name__}'"
334334
else:
335335
expected_exception = TypeError
336336
msg = (
337337
"loop of ufunc does not support argument 0 of type tuple which"
338-
" has no callable {} method"
339-
).format(func.__name__)
338+
f" has no callable {func.__name__} method"
339+
)
340340
with pytest.raises(expected_exception, match=msg):
341341
func(idx)
342342

@@ -348,9 +348,9 @@ def test_numpy_ufuncs(idx, func):
348348
)
349349
def test_numpy_type_funcs(idx, func):
350350
msg = (
351-
"ufunc '{}' not supported for the input types, and the inputs"
351+
f"ufunc '{func.__name__}' not supported for the input types, and the inputs"
352352
" could not be safely coerced to any supported types according to"
353353
" the casting rule ''safe''"
354-
).format(func.__name__)
354+
)
355355
with pytest.raises(TypeError, match=msg):
356356
func(idx)

0 commit comments

Comments
 (0)