File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -1245,8 +1245,7 @@ def setUp(self):
1245
1245
d = 6
1246
1246
e = 7
1247
1247
""" )
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 ]})
1250
1249
1251
1250
def test_report_43_is_ok (self ):
1252
1251
st , out = self .run_command_status ("coverage report --fail-under=43" )
@@ -1267,16 +1266,14 @@ def test_report_42p86_is_not_ok(self):
1267
1266
assert expected == self .last_line_squeezed (out )
1268
1267
1269
1268
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 )})
1280
1277
st , out = self .run_command_status ("coverage report --fail-under=100" )
1281
1278
assert st == 2
1282
1279
expected = "Coverage failure: total of 99 is less than fail-under=100"
You can’t perform that action at this time.
0 commit comments