@@ -158,7 +158,7 @@ def test_precise_conversion(c_parser_only):
158158 # test numbers between 1 and 2
159159 for num in np .linspace (1.0 , 2.0 , num = 500 ):
160160 # 25 decimal digits of precision
161- text = "a\n {0 :.25}" . format ( num )
161+ text = f "a\n { num :.25} "
162162
163163 normal_val = float (parser .read_csv (StringIO (text ))["a" ][0 ])
164164 precise_val = float (
@@ -170,7 +170,7 @@ def test_precise_conversion(c_parser_only):
170170 actual_val = Decimal (text [2 :])
171171
172172 def error (val ):
173- return abs (Decimal ("{0 :.100}". format ( val ) ) - actual_val )
173+ return abs (Decimal (f" { val :.100} " ) - actual_val )
174174
175175 normal_errors .append (error (normal_val ))
176176 precise_errors .append (error (precise_val ))
@@ -299,9 +299,7 @@ def test_grow_boundary_at_cap(c_parser_only):
299299
300300 def test_empty_header_read (count ):
301301 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 )])
305303 df = parser .read_csv (s )
306304 tm .assert_frame_equal (df , expected )
307305
@@ -489,7 +487,7 @@ def test_comment_whitespace_delimited(c_parser_only, capsys):
489487 captured = capsys .readouterr ()
490488 # skipped lines 2, 3, 4, 9
491489 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
493491 expected = DataFrame ([[1 , 2 ], [5 , 2 ], [6 , 2 ], [7 , np .nan ], [8 , np .nan ]])
494492 tm .assert_frame_equal (df , expected )
495493
0 commit comments