File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -1245,8 +1245,7 @@ def setUp(self):
12451245 d = 6
12461246 e = 7
12471247 """ )
1248- st , _ = self .run_command_status ("coverage run --source=. forty_two_plus.py" )
1249- assert st == 0
1248+ self .make_data_file (lines = {abs_file ("forty_two_plus.py" ): [2 , 3 , 4 ]})
12501249
12511250 def test_report_43_is_ok (self ):
12521251 st , out = self .run_command_status ("coverage report --fail-under=43" )
@@ -1267,16 +1266,14 @@ def test_report_42p86_is_not_ok(self):
12671266 assert expected == self .last_line_squeezed (out )
12681267
12691268 def test_report_99p9_is_not_ok (self ):
1270- # A file with 99.99% coverage:
1271- self .make_file ("ninety_nine_plus.py" , """\
1272- a = 1
1273- """ + """
1274- b = 2
1275- """ * 20000 + """
1276- if a > 3:
1277- c = 4
1278- """ )
1279- self .run_command ("coverage run --source=. ninety_nine_plus.py" )
1269+ # A file with 99.9% coverage:
1270+ self .make_file ("ninety_nine_plus.py" ,
1271+ "a = 1\n " +
1272+ "b = 2\n " * 2000 +
1273+ "if a > 3:\n " +
1274+ " c = 4\n "
1275+ )
1276+ self .make_data_file (lines = {abs_file ("ninety_nine_plus.py" ): range (1 , 2002 )})
12801277 st , out = self .run_command_status ("coverage report --fail-under=100" )
12811278 assert st == 2
12821279 expected = "Coverage failure: total of 99 is less than fail-under=100"
You can’t perform that action at this time.
0 commit comments