Skip to content

Commit

Permalink
test: use pragma: no cover (#110)
Browse files Browse the repository at this point in the history
* test: use `pragma: no cover`
  • Loading branch information
DeadNews authored Jun 24, 2023
1 parent c01c6c5 commit c47567a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
pkgname: python-images-upload-cli
pkgbuild: ./PKGBUILD
commit_username: DeadNews
commit_email: uhjnnn@gmail.com
commit_email: aurczpbgr@mozmail.com
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Upstream release ${{ github.ref }}
updpkgsums: true
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ testpaths = ["tests"]
markers = ["docker", "key_required"]

[tool.coverage.report]
exclude_lines = ["if TYPE_CHECKING:", "if __name__ == .__main__.:"]
exclude_lines = [
"# pragma: no cover",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.ruff]
line-length = 99
Expand Down
6 changes: 3 additions & 3 deletions src/images_upload_cli/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def get_font() -> ImageFont.FreeTypeFont:
msg = (
f"None of the default fonts were found: {font_names}.\n"
f"Please setup CAPTION_FONT in environment variables or in '{get_config_path()}'.",
)
raise GetEnvError(msg)
) # pragma: no cover
raise GetEnvError(msg) # pragma: no cover


def make_thumbnail(img: bytes, size: tuple[int, int] = (300, 300)) -> bytes:
Expand Down Expand Up @@ -119,4 +119,4 @@ def make_thumbnail(img: bytes, size: tuple[int, int] = (300, 300)) -> bytes:
def notify_send(text_to_print: str) -> None:
"""Send desktop notifications via libnotify."""
if notify_send := which("notify-send"):
Popen([notify_send, "-a", "images-upload-cli", text_to_print])
Popen([notify_send, "-a", "images-upload-cli", text_to_print]) # pragma: no cover

0 comments on commit c47567a

Please sign in to comment.