Skip to content

Commit 2302c09

Browse files
3vtsroberthdevries
authored andcommitted
Eighth batch of changes (pandas-dev#32032)
1 parent c0fdb3f commit 2302c09

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

pandas/tests/test_downstream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def import_module(name):
1919
try:
2020
return importlib.import_module(name)
2121
except ModuleNotFoundError: # noqa
22-
pytest.skip("skipping as {} not available".format(name))
22+
pytest.skip(f"skipping as {name} not available")
2323

2424

2525
@pytest.fixture

pandas/tests/test_multilevel.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,10 @@ def test_stack_unstack_unordered_multiindex(self):
896896
values = np.arange(5)
897897
data = np.vstack(
898898
[
899-
["b{}".format(x) for x in values], # b0, b1, ..
900-
["a{}".format(x) for x in values],
899+
[f"b{x}" for x in values], # b0, b1, ..
900+
[f"a{x}" for x in values], # a0, a1, ..
901901
]
902-
) # a0, a1, ..
902+
)
903903
df = pd.DataFrame(data.T, columns=["b", "a"])
904904
df.columns.name = "first"
905905
second_level_dict = {"x": df}

pandas/tests/tools/test_numeric.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def test_really_large_in_arr_consistent(large_val, signed, multiple_elts, errors
308308

309309
if errors in (None, "raise"):
310310
index = int(multiple_elts)
311-
msg = "Integer out of range. at position {index}".format(index=index)
311+
msg = f"Integer out of range. at position {index}"
312312

313313
with pytest.raises(ValueError, match=msg):
314314
to_numeric(arr, **kwargs)

pandas/tests/tslibs/test_parse_iso8601.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_parsers_iso8601(date_str, exp):
5151
],
5252
)
5353
def test_parsers_iso8601_invalid(date_str):
54-
msg = 'Error parsing datetime string "{s}"'.format(s=date_str)
54+
msg = f'Error parsing datetime string "{date_str}"'
5555

5656
with pytest.raises(ValueError, match=msg):
5757
tslib._test_parse_iso8601(date_str)

pandas/tests/window/moments/test_moments_rolling.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ def get_result(obj, window, min_periods=None, center=False):
860860
tm.assert_series_equal(result, expected)
861861

862862
# shifter index
863-
s = ["x{x:d}".format(x=x) for x in range(12)]
863+
s = [f"x{x:d}" for x in range(12)]
864864

865865
if has_min_periods:
866866
minp = 10
@@ -1437,13 +1437,9 @@ def test_rolling_median_memory_error(self):
14371437
def test_rolling_min_max_numeric_types(self):
14381438

14391439
# GH12373
1440-
types_test = [np.dtype("f{}".format(width)) for width in [4, 8]]
1440+
types_test = [np.dtype(f"f{width}") for width in [4, 8]]
14411441
types_test.extend(
1442-
[
1443-
np.dtype("{}{}".format(sign, width))
1444-
for width in [1, 2, 4, 8]
1445-
for sign in "ui"
1446-
]
1442+
[np.dtype(f"{sign}{width}") for width in [1, 2, 4, 8] for sign in "ui"]
14471443
)
14481444
for data_type in types_test:
14491445
# Just testing that these don't throw exceptions and that

0 commit comments

Comments
 (0)