File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,29 @@ def foo():
538
538
assert squeezed [4 ] == "not_covered.py 4 0 2 1 83.333%"
539
539
assert squeezed [6 ] == "TOTAL 13 0 4 1 94.118%"
540
540
541
+ def test_report_precision_all_zero (self ):
542
+ self .make_file ("not_covered.py" , """
543
+ def not_covered(n):
544
+ if n:
545
+ print("n")
546
+ """ )
547
+ self .make_file ("empty.py" , "" )
548
+ cov = coverage .Coverage (source = ["." ])
549
+ self .start_import_stop (cov , "empty" )
550
+ report = self .get_report (cov , precision = 6 , squeeze = False )
551
+
552
+ # Name Stmts Miss Cover
553
+ # -----------------------------------------
554
+ # empty.py 0 0 100.000000%
555
+ # not_covered.py 3 3 0.000000%
556
+ # -----------------------------------------
557
+ # TOTAL 3 3 0.000000%
558
+
559
+ assert self .line_count (report ) == 6 , report
560
+ assert "empty.py 0 0 100.000000%" in report
561
+ assert "not_covered.py 3 3 0.000000%" in report
562
+ assert "TOTAL 3 3 0.000000%" in report
563
+
541
564
def test_dotpy_not_python (self ):
542
565
# We run a .py file, and when reporting, we can't parse it as Python.
543
566
# We should get an error message in the report.
You can’t perform that action at this time.
0 commit comments