Skip to content

Commit cee04d5

Browse files
rgaudinbenoit74
authored andcommitted
Disable cover on special blocks
Three blocks of code had to be marked no cover. Those blocks are entered and tested but coverage reports them as missing. It might be due to the decorator… I've tried to simplify the code leading to it but could fix the missing lines… Once we merge this, I'll open a ticket to revisit this in the future.
1 parent c3ffd0b commit cee04d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/zimscraperlib/rewriting/html.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def rewrite_meta_charset_content(
560560
return
561561
if attr_name == "charset":
562562
return (attr_name, "UTF-8")
563-
if attr_name == "content" and any(
563+
if attr_name == "content" and any( # pragma: no coverage (coverage bug)
564564
attr_name.lower() == "http-equiv"
565565
and attr_value
566566
and attr_value.lower() == "content-type"
@@ -574,7 +574,9 @@ def rewrite_onxxx_tags(
574574
attr_name: str, attr_value: str | None, js_rewriter: JsRewriter
575575
) -> AttrNameAndValue | None:
576576
"""Rewrite onxxx script attributes"""
577-
if attr_value and attr_name.startswith("on") and not attr_name.startswith("on-"):
577+
if (
578+
attr_value and attr_name.startswith("on") and not attr_name.startswith("on-")
579+
): # pragma: no coverage (coverage bug)
578580
return (attr_name, js_rewriter.rewrite(attr_value))
579581

580582

@@ -583,7 +585,7 @@ def rewrite_style_tags(
583585
attr_name: str, attr_value: str | None, css_rewriter: CssRewriter
584586
) -> AttrNameAndValue | None:
585587
"""Rewrite style attributes"""
586-
if attr_value and attr_name == "style":
588+
if attr_value and attr_name == "style": # pragma: no coverage (coverage bug)
587589
return (attr_name, css_rewriter.rewrite_inline(attr_value))
588590

589591

0 commit comments

Comments
 (0)