Skip to content

Fix failing CLI tests by mocking interactive prompt#622

Merged
andrewtavis merged 2 commits into
scribe-org:mainfrom
DeleMike:fix/project-depedencies
Jun 26, 2025
Merged

Fix failing CLI tests by mocking interactive prompt#622
andrewtavis merged 2 commits into
scribe-org:mainfrom
DeleMike:fix/project-depedencies

Conversation

@DeleMike
Copy link
Copy Markdown
Collaborator

Contributor checklist


Description

Patched check_index_exists in two test cases to prevent EOFError caused by interactive prompts in non-interactive environments. This ensures tests for get_data() run smoothly in CI by simulating prompt behaviour.

Related issue

DeleMike added 2 commits June 25, 2025 16:08
- 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
@github-actions
Copy link
Copy Markdown
Contributor

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 General and Data rooms once you're in. Also consider attending our bi-weekly Saturday dev syncs. It'd be great to meet you 😊

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 25, 2025

Maintainer Checklist

The 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 :)

  • The linting and formatting workflow within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@DeleMike DeleMike changed the title Fix EOFError in test_get_data_* tests caused by interactive file overwrite prompts Fix failing CLI tests by mocking interactive prompt Jun 25, 2025
@DeleMike
Copy link
Copy Markdown
Collaborator Author

Hi @andrewtavis, here is the fix for the issue. Let me know if you have any questions.

cc: @axif0

@andrewtavis andrewtavis requested review from andrewtavis and axif0 June 25, 2025 17:01
Copy link
Copy Markdown
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, @DeleMike! Thanks for the test fixes! Awesome to have you contributing to Scribe-Data again! 😊

@andrewtavis andrewtavis merged commit 61c763b into scribe-org:main Jun 26, 2025
7 checks passed
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.

Tests test_get_data_with_interactive_mode and test_get_data_case_insensitive_type fail with EOFError due to interactive prompts

2 participants