Fix failing CLI tests by mocking interactive prompt#622
Conversation
- Add @patch decorator for check_index_exists in test_get_data_with_interactive_mode and test_get_data_case_insensitive_type - Mock return value as False to prevent questionary prompts when JSON files exist - Fixes EOFError caused by interactive "Choose an action" prompts in test environment - Ensures tests run without requiring user input in automated environments
Thank you for the pull request! ❤️The Scribe-Data team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) |
|
Hi @andrewtavis, here is the fix for the issue. Let me know if you have any questions. cc: @axif0 |
andrewtavis
left a comment
There was a problem hiding this comment.
Looks great to me, @DeleMike! Thanks for the test fixes! Awesome to have you contributing to Scribe-Data again! 😊
Contributor checklist
pytestcommand as directed in the testing section of the contributing guideDescription
Patched
check_index_existsin two test cases to prevent EOFError caused by interactive prompts in non-interactive environments. This ensures tests forget_data()run smoothly in CI by simulating prompt behaviour.Related issue
test_get_data_with_interactive_modeandtest_get_data_case_insensitive_typefail with EOFError due to interactive prompts #621