@@ -158,7 +158,7 @@ def test_precise_conversion(c_parser_only):
158
158
# test numbers between 1 and 2
159
159
for num in np .linspace (1.0 , 2.0 , num = 500 ):
160
160
# 25 decimal digits of precision
161
- text = "a\n {0 :.25}" . format ( num )
161
+ text = f "a\n { num :.25} "
162
162
163
163
normal_val = float (parser .read_csv (StringIO (text ))["a" ][0 ])
164
164
precise_val = float (
@@ -170,7 +170,7 @@ def test_precise_conversion(c_parser_only):
170
170
actual_val = Decimal (text [2 :])
171
171
172
172
def error (val ):
173
- return abs (Decimal ("{0 :.100}". format ( val ) ) - actual_val )
173
+ return abs (Decimal (f" { val :.100} " ) - actual_val )
174
174
175
175
normal_errors .append (error (normal_val ))
176
176
precise_errors .append (error (precise_val ))
@@ -299,9 +299,7 @@ def test_grow_boundary_at_cap(c_parser_only):
299
299
300
300
def test_empty_header_read (count ):
301
301
s = StringIO ("," * count )
302
- expected = DataFrame (
303
- columns = ["Unnamed: {i}" .format (i = i ) for i in range (count + 1 )]
304
- )
302
+ expected = DataFrame (columns = [f"Unnamed: { i } " for i in range (count + 1 )])
305
303
df = parser .read_csv (s )
306
304
tm .assert_frame_equal (df , expected )
307
305
@@ -489,7 +487,7 @@ def test_comment_whitespace_delimited(c_parser_only, capsys):
489
487
captured = capsys .readouterr ()
490
488
# skipped lines 2, 3, 4, 9
491
489
for line_num in (2 , 3 , 4 , 9 ):
492
- assert "Skipping line {}" . format ( line_num ) in captured .err
490
+ assert f "Skipping line { line_num } " in captured .err
493
491
expected = DataFrame ([[1 , 2 ], [5 , 2 ], [6 , 2 ], [7 , np .nan ], [8 , np .nan ]])
494
492
tm .assert_frame_equal (df , expected )
495
493
0 commit comments