From ba422b535a13bd6500237dd86b76b6158bc18931 Mon Sep 17 00:00:00 2001 From: Thomas J Fan Date: Mon, 3 Feb 2020 20:55:49 -0500 Subject: [PATCH] CLN Replace format in test_repr_info --- pandas/tests/frame/test_repr_info.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pandas/tests/frame/test_repr_info.py b/pandas/tests/frame/test_repr_info.py index 49e6fe4940e18..a7e01d8f1fd6d 100644 --- a/pandas/tests/frame/test_repr_info.py +++ b/pandas/tests/frame/test_repr_info.py @@ -223,8 +223,7 @@ def test_info_verbose(self): for i, line in enumerate(lines): if i >= start and i < start + size: - index = i - start - line_nr = " {} ".format(index) + line_nr = f" {i - start} " assert line.startswith(line_nr) def test_info_memory(self): @@ -236,7 +235,7 @@ def test_info_memory(self): bytes = float(df.memory_usage().sum()) expected = textwrap.dedent( - """\ + f"""\ RangeIndex: 2 entries, 0 to 1 Data columns (total 1 columns): @@ -244,10 +243,8 @@ def test_info_memory(self): --- ------ -------------- ----- 0 a 2 non-null int64 dtypes: int64(1) - memory usage: {} bytes - """.format( - bytes - ) + memory usage: {bytes} bytes + """ ) assert result == expected @@ -313,9 +310,7 @@ def test_info_shows_column_dtypes(self): ) assert header in res for i, dtype in enumerate(dtypes): - name = " {i:d} {i:d} {n:d} non-null {dtype}".format( - i=i, n=n, dtype=dtype - ) + name = f" {i:d} {i:d} {n:d} non-null {dtype}" assert name in res def test_info_max_cols(self):