Skip to content

Commit

Permalink
#31 Clean up test case and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
roskakori committed Nov 27, 2024
1 parent 344f2de commit 2fa5cd8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion check_done/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ def main():
sys.exit(check_done_command())


if __name__ == "__main__":
if __name__ == "__main__": # pragma: no cover
main()
12 changes: 0 additions & 12 deletions tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import os
import re
import subprocess
import tempfile
from pathlib import Path
from unittest.mock import patch
Expand Down Expand Up @@ -126,17 +125,6 @@ def test_can_check_done_demo_project(caplog):
)


@pytest.mark.skipif(
not HAS_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
reason=REASON_SHOULD_HAVE_DEMO_CHECK_DONE_ORGANIZATION_PROJECT_CONFIGURED,
)
def test_main_script():
path = Path(__file__).resolve().parent.parent / "check_done" / "command.py"
command = f"poetry run python {path.as_posix()!s} --config {_PATH_TO_TEST_CONFIG.as_posix()!s}"
result = subprocess.run(command, capture_output=True, text=True, shell=True, check=False)
assert "Checking project items" in result.stderr


def test_can_handle_keyboard_interrupt():
with patch("check_done.command.execute", side_effect=KeyboardInterrupt):
exit_code = check_done_command([])
Expand Down

0 comments on commit 2fa5cd8

Please sign in to comment.