Skip to content

Commit

Permalink
Fix nocover pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Feb 8, 2024
1 parent f3d6e09 commit 07755c3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/zimscraperlib/fix_ogvjs_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def fix_source_dir(source_vendors_path: Union[pathlib.Path, str]):


def run():
if len(sys.argv) < 2: # noqa: PLR2004
if len(sys.argv) < 2: # noqa: PLR2004 # pragma: no cover
print(f"Usage: {sys.argv[0]} <source_vendors_path>") # noqa: T201
print( # noqa: T201
"\t<source_vendors_path>\tpath to your folder containing "
Expand Down
4 changes: 2 additions & 2 deletions src/zimscraperlib/image/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def optimize_webp(
save_image(webp_image, dst, fmt="WEBP", **params) # pyright: ignore
except Exception as exc:
if src.resolve() != dst.resolve() and dst.exists(): # pyright: ignore
dst.unlink() # pragma: nocover
dst.unlink() # pragma: no cover
raise exc
return dst # pyright: ignore

Expand Down Expand Up @@ -256,7 +256,7 @@ def optimize_gif(

# remove dst if gifsicle failed and src is different from dst
if gifsicle.returncode != 0 and src.resolve() != dst.resolve() and dst.exists():
dst.unlink() # pragma: nocover
dst.unlink() # pragma: no cover

# raise error if unsuccessful
gifsicle.check_returncode()
Expand Down
2 changes: 1 addition & 1 deletion src/zimscraperlib/zim/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_tags(self, libkiwix: bool = False) -> List[str]: # noqa: FBT001, FBT002
"""List of ZIM tags, optionnaly expanded with libkiwix's hints"""
try:
tags_meta = self.get_text_metadata("Tags")
except RuntimeError: # pragma: nocover
except RuntimeError: # pragma: no cover
tags_meta = ""

if libkiwix:
Expand Down
6 changes: 3 additions & 3 deletions src/zimscraperlib/zim/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def get_size(self) -> int:
return self.size # pyright: ignore

def gen_blob(self) -> libzim.writer.Blob:
yield libzim.writer.Blob(
yield libzim.writer.Blob( # pragma: no cover
self.fileobj.getvalue() # pyright: ignore
) # pragma: nocover
)


class URLProvider(libzim.writer.ContentProvider):
Expand Down Expand Up @@ -95,7 +95,7 @@ def get_size_of(url) -> Union[int, None]:
def get_size(self) -> int:
return self.size # pyright: ignore

def gen_blob(self) -> libzim.writer.Blob: # pragma: nocover
def gen_blob(self) -> libzim.writer.Blob:
for chunk in self.resp.iter_content(10 * 1024):
if chunk:
yield libzim.writer.Blob(chunk)
Expand Down

0 comments on commit 07755c3

Please sign in to comment.