Skip to content

Commit bacd48b

Browse files
authored
CLN Replace format in test_repr_info (#31639)
1 parent be9ee6d commit bacd48b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pandas/tests/frame/test_repr_info.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ def test_info_verbose(self):
223223

224224
for i, line in enumerate(lines):
225225
if i >= start and i < start + size:
226-
index = i - start
227-
line_nr = " {} ".format(index)
226+
line_nr = f" {i - start} "
228227
assert line.startswith(line_nr)
229228

230229
def test_info_memory(self):
@@ -236,18 +235,16 @@ def test_info_memory(self):
236235
bytes = float(df.memory_usage().sum())
237236

238237
expected = textwrap.dedent(
239-
"""\
238+
f"""\
240239
<class 'pandas.core.frame.DataFrame'>
241240
RangeIndex: 2 entries, 0 to 1
242241
Data columns (total 1 columns):
243242
# Column Non-Null Count Dtype
244243
--- ------ -------------- -----
245244
0 a 2 non-null int64
246245
dtypes: int64(1)
247-
memory usage: {} bytes
248-
""".format(
249-
bytes
250-
)
246+
memory usage: {bytes} bytes
247+
"""
251248
)
252249

253250
assert result == expected
@@ -313,9 +310,7 @@ def test_info_shows_column_dtypes(self):
313310
)
314311
assert header in res
315312
for i, dtype in enumerate(dtypes):
316-
name = " {i:d} {i:d} {n:d} non-null {dtype}".format(
317-
i=i, n=n, dtype=dtype
318-
)
313+
name = f" {i:d} {i:d} {n:d} non-null {dtype}"
319314
assert name in res
320315

321316
def test_info_max_cols(self):

0 commit comments

Comments
 (0)