Commits

Ned Batchelder  committed d59cab8

Annotations on yellow HTML lines with the line numbers not visited.

  • Participants
  • Parent commits 24afc67

Comments (0)

Files changed (5)

 
 * 3.2
 
-- Some kind of indication in the HTML where yellow lines aren't going.
++ Some kind of indication in the HTML where yellow lines aren't going.
 - Profile the reporting code: it's REALLY slow.
     - parser is doing some redundant work.
 - while TRUE claims to be partial?
 + Analysis class should do rolling up of stats also (actually Numbers)
 - Update docs for --branch.
 - self.coverage.data.has_arcs is ugly.
-
+- Branches that never jump to nocover lines shouldn't be marked as partial.
+    (see top of test_cogapp for examples)
 
 * Speed
 

File coverage/html.py

                 if part == '\n':
 
                     line_class = ""
+                    annotate = ""
                     if lineno in analysis.statements:
                         line_class += " stm"
                     if lineno in analysis.excluded:
                     elif self.arcs and lineno in missing_branch_arcs:
                         line_class += c_par
                         n_par += 1
+                        annotate = " ".join(map(str, missing_branch_arcs[lineno]))
                     elif lineno in analysis.statements:
                         line_class += c_run
                         
                     lineinfo = {
                         'html': "".join(line),
                         'number': lineno,
-                        'class': line_class.strip() or "pln"
+                        'class': line_class.strip() or "pln",
+                        'annotate': annotate,
                     }
                     lines.append(lineinfo)
                     

File coverage/htmlfiles/pyfile.html

 </td>
 <td class='text' valign='top'>
     {% for line in lines %}
-    <p class='{{line.class}}'>{{line.html}}<span class="strut">&nbsp;</span></p>
+    <p class='{{line.class}}'>{% if line.annotate %}<span class='annotate'>{{line.annotate}}</span>{% endif %}{{line.html}}<span class='strut'>&nbsp;</span></p>
     {% endfor %}
 </td>
 </tr>

File coverage/htmlfiles/style.css

     background: inherit;
     }
 
+.text span.annotate {
+	font-family: georgia;
+	font-style: italic;
+	color: #666;
+	float: right;
+	padding-right: .5em;
+	}
+.text p.hide span.annotate {
+	display: none;
+	}
+	
 /* Syntax coloring */
 .text .com {
     color: green;

File test/farm/html/gold_other/style.css

     background: #eeeeee;
     border-left: 2px solid #808080;
     }
+.text p.par {
+    background: #ffffaa;
+    border-left: 2px solid #eeee99;
+    }
 .text p.hide {
     background: inherit;
     }
 
+.text span.annotate {
+	font-family: georgia;
+	font-style: italic;
+	color: #666;
+	float: right;
+	padding-right: .5em;
+	}
+.text p.hide span.annotate {
+	display: none;
+	}
+	
 /* Syntax coloring */
 .text .com {
-	color: green;
-	font-style: italic;
-	line-height: 1px;
-	}
+    color: green;
+    font-style: italic;
+    line-height: 1px;
+    }
 .text .key {
-	font-weight: bold;
-	line-height: 1px;
-	}
+    font-weight: bold;
+    line-height: 1px;
+    }
 .text .str {
-	color: #000080;
-	}
+    color: #000080;
+    }
 
 /* index styles */
 #index td, #index th {
 #index td.name, #index th.name {
     text-align: left;
     width: auto;
-    height: 1.5em;
     }
 #index td.name a {
     text-decoration: none;
     border-top: 1px solid #ccc;
     border-bottom: none;
     }
+#index tr.file:hover {
+	background: #eeeeee;
+	}