Skip to content

Commit 4399f96

Browse files
committed
Fix nocover pragmas
1 parent f3d6e09 commit 4399f96

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/zimscraperlib/fix_ogvjs_dist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def fix_source_dir(source_vendors_path: Union[pathlib.Path, str]):
3434

3535

3636
def run():
37-
if len(sys.argv) < 2: # noqa: PLR2004
37+
if len(sys.argv) < 2: # noqa: PLR2004 # pragma: no cover
3838
print(f"Usage: {sys.argv[0]} <source_vendors_path>") # noqa: T201
3939
print( # noqa: T201
4040
"\t<source_vendors_path>\tpath to your folder containing "

src/zimscraperlib/image/optimization.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def optimize_webp(
205205
save_image(webp_image, dst, fmt="WEBP", **params) # pyright: ignore
206206
except Exception as exc:
207207
if src.resolve() != dst.resolve() and dst.exists(): # pyright: ignore
208-
dst.unlink() # pragma: nocover
208+
dst.unlink() # pragma: no cover
209209
raise exc
210210
return dst # pyright: ignore
211211

@@ -256,7 +256,7 @@ def optimize_gif(
256256

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

261261
# raise error if unsuccessful
262262
gifsicle.check_returncode()

src/zimscraperlib/zim/archive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_tags(self, libkiwix: bool = False) -> List[str]: # noqa: FBT001, FBT002
4343
"""List of ZIM tags, optionnaly expanded with libkiwix's hints"""
4444
try:
4545
tags_meta = self.get_text_metadata("Tags")
46-
except RuntimeError: # pragma: nocover
46+
except RuntimeError: # pragma: no cover
4747
tags_meta = ""
4848

4949
if libkiwix:

src/zimscraperlib/zim/providers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def get_size(self) -> int:
6161
return self.size # pyright: ignore
6262

6363
def gen_blob(self) -> libzim.writer.Blob:
64-
yield libzim.writer.Blob(
64+
yield libzim.writer.Blob( # pragma: no cover
6565
self.fileobj.getvalue() # pyright: ignore
66-
) # pragma: nocover
66+
)
6767

6868

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

98-
def gen_blob(self) -> libzim.writer.Blob: # pragma: nocover
98+
def gen_blob(self) -> libzim.writer.Blob: # pragma: no cover
9999
for chunk in self.resp.iter_content(10 * 1024):
100100
if chunk:
101101
yield libzim.writer.Blob(chunk)

0 commit comments

Comments
 (0)