Skip to content

🧪 Add test coverage for CLI commands#3

Open
harshithluc073 wants to merge 1 commit intomainfrom
test/cli-coverage-14798355343238338772
Open

🧪 Add test coverage for CLI commands#3
harshithluc073 wants to merge 1 commit intomainfrom
test/cli-coverage-14798355343238338772

Conversation

@harshithluc073
Copy link
Owner

🎯 What: The CLI entry point neuroscope/cli.py was missing test coverage.
📊 Coverage: Added tests for:

  • main() invocation with no arguments, or with valid server/demo/version arguments.
  • Default argument fallback behavior for server and demo commands.
  • run_server() to verify that NeuroScopeServer instances are correctly instantiated and .start()/.stop() sequences happen on user KeyboardInterrupt.
  • run_demo() with ML model permutations (mlp, cnn, transformer).
  • run_demo() error handling when torch is not installed on the system.
  • show_version() to ensure the package version is printed.
    Result: Substantial improvement in test coverage for CLI routing logic. Changes are isolated to tests and do not introduce regressions.

PR created automatically by Jules for task 14798355343238338772 started by @harshithluc073

Adds comprehensive unit tests for `neuroscope/cli.py` to ensure proper argument parsing, command routing, and correct behavior of `main()`, `run_server()`, `run_demo()`, and `show_version()`. Mocking is used heavily to verify behavior deterministically without the need to bind network ports, load slow machine learning framework binaries, or start infinite sleep loops.

Co-authored-by: harshithluc073 <101515387+harshithluc073@users.noreply.github.com>
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.

1 participant