@@ -22,7 +22,7 @@ def test_usage():
2222 """usage"""
2323
2424 for flag in ['-h' , '--help' ]:
25- rv , out = getstatusoutput ('{ } {}' . format ( prg , flag ) )
25+ rv , out = getstatusoutput (f' { prg } { flag } ' )
2626 assert rv == 0
2727 assert re .match ("usage" , out , re .IGNORECASE )
2828
@@ -31,7 +31,7 @@ def test_usage():
3131def test_bad_int ():
3232 """Bad integer value"""
3333
34- rv , out = getstatusoutput ('{ } -n -1'. format ( prg ) )
34+ rv , out = getstatusoutput (f' { prg } -n -1' )
3535 assert rv != 0
3636 assert re .search (r'--num \(-1\) must > 0' , out )
3737
@@ -40,7 +40,7 @@ def test_bad_int():
4040def test_float ():
4141 """float value"""
4242
43- rv , out = getstatusoutput ('{ } --num 2.1'. format ( prg ) )
43+ rv , out = getstatusoutput (f' { prg } --num 2.1' )
4444 assert rv != 0
4545 assert re .search (r"invalid int value: '2.1'" , out )
4646
@@ -49,7 +49,7 @@ def test_float():
4949def test_str ():
5050 """str value"""
5151
52- rv , out = getstatusoutput ('{ } -n lsdfkl'. format ( prg ) )
52+ rv , out = getstatusoutput (f' { prg } -n lsdfkl' )
5353 assert rv != 0
5454 assert re .search (r"invalid int value: 'lsdfkl'" , out )
5555
@@ -63,7 +63,7 @@ def test_one():
6363 'Take one down, pass it around,\n '
6464 'No more bottles of beer on the wall!' )
6565
66- rv , out = getstatusoutput ('{ } --num 1'. format ( prg ) )
66+ rv , out = getstatusoutput (f' { prg } --num 1' )
6767 assert rv == 0
6868 assert out == expected
6969
@@ -81,7 +81,7 @@ def test_two():
8181 'Take one down, pass it around,\n '
8282 'No more bottles of beer on the wall!' )
8383
84- rv , out = getstatusoutput ('{ } -n 2'. format ( prg ) )
84+ rv , out = getstatusoutput (f' { prg } -n 2' )
8585 assert rv == 0
8686 assert out == expected
8787
@@ -96,7 +96,7 @@ def test_random():
9696
9797 for n in random .choices (list (sums .keys ()), k = 10 ):
9898 flag = '-n' if random .choice ([0 , 1 ]) == 1 else '--num'
99- rv , out = getstatusoutput ('{ } {} {}' . format ( prg , flag , n ) )
99+ rv , out = getstatusoutput (f' { prg } { flag } { n } ' )
100100 out += '\n ' # because the last newline is removed
101101 assert rv == 0
102102 assert hashlib .md5 (out .encode ('utf-8' )).hexdigest () == sums [n ]
0 commit comments