Skip to content

Conversation

Copy link

Copilot AI commented Oct 26, 2025

Implements test infrastructure for the CLI dispatcher module with GitHub Actions integration.

Changes

  • Test suite (tests/test_main.py): 7 test cases covering CLI argument parsing, command validation, and module dispatch logic. Achieves 95% coverage of rhasspy/__main__.py.

  • CI workflow (.github/workflows/tests.yml): Runs tests across Python 3.7-3.11 with coverage reporting and Codecov integration. Includes explicit permissions: contents: read to limit GITHUB_TOKEN scope.

  • Build artifacts: Updated .gitignore to exclude pytest/coverage artifacts (.coverage, .pytest_cache, htmlcov/, coverage.xml).

Example

def test_main_unknown_command(capsys):
    """Test main() with unknown command shows error."""
    with mock.patch.object(sys, "argv", ["rhasspy", "unknown-command"]):
        with pytest.raises(SystemExit) as exc_info:
            main()
        assert exc_info.value.code == 1
Original prompt

add tests


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits October 26, 2025 19:08
Co-authored-by: steveward <721500+steveward@users.noreply.github.com>
Co-authored-by: steveward <721500+steveward@users.noreply.github.com>
Co-authored-by: steveward <721500+steveward@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for existing functionality Add test suite and CI workflow Oct 26, 2025
Copilot AI requested a review from steveward October 26, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants