Commit bfee701
authored
* fix: endblock falsely reported as uncovered when on its own line (issue #74)
In parent templates, a TEXT token inside a {% block %} can end with a
whitespace-only fragment before {% endblock %} with no newline terminator.
That fragment is not an executable line but was incorrectly added to
source_lines, causing {% endblock %} to appear as an uncovered line.
Skip the trailing fragment when inside a block (inblock=True).
* fix: skipped tags falsely reported as uncovered when not at start of line
When a tag ({% endif %}, {% endfor %}, {% else %}, etc.) is not at the
start of a line, the preceding TEXT token ends with a whitespace-only
fragment with no newline terminator. That partial line is not executable
content but was incorrectly added to source_lines.
Extends the endblock fix to apply universally — built-in and user-defined
end tags are all covered by the same condition.
* Update missed assertion when runing Django < 4
1 parent 59954f3 commit bfee701
File tree
4 files changed
+127
-5
lines changed- django_coverage_plugin
- tests
4 files changed
+127
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
352 | 359 | | |
353 | 360 | | |
354 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
98 | 166 | | |
99 | 167 | | |
100 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
28 | 53 | | |
29 | 54 | | |
30 | 55 | | |
| |||
84 | 109 | | |
85 | 110 | | |
86 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
87 | 123 | | |
88 | 124 | | |
89 | 125 | | |
| |||
135 | 171 | | |
136 | 172 | | |
137 | 173 | | |
138 | | - | |
| 174 | + | |
139 | 175 | | |
140 | 176 | | |
141 | 177 | | |
| |||
154 | 190 | | |
155 | 191 | | |
156 | 192 | | |
157 | | - | |
| 193 | + | |
158 | 194 | | |
159 | 195 | | |
160 | 196 | | |
| |||
170 | 206 | | |
171 | 207 | | |
172 | 208 | | |
173 | | - | |
| 209 | + | |
174 | 210 | | |
175 | 211 | | |
176 | 212 | | |
| |||
190 | 226 | | |
191 | 227 | | |
192 | 228 | | |
193 | | - | |
| 229 | + | |
194 | 230 | | |
195 | 231 | | |
196 | 232 | | |
| |||
206 | 242 | | |
207 | 243 | | |
208 | 244 | | |
209 | | - | |
| 245 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
241 | 252 | | |
242 | 253 | | |
243 | 254 | | |
| |||
0 commit comments