-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: simplify test cases to reduce calls to gpt #69
test: simplify test cases to reduce calls to gpt #69
Conversation
reduce test cases without reducing coverage
## Description <!-- Prefix the PR title with 'feat:' to increment the minor version, or 'fix:' to increment the patch version --> <!-- Describe what changes this PR introduces and their effects --> <!-- Update documentation if there are any changes to existing features or APIs --> ## Testing <!-- Describe how you tested your changes and how reviewers can test them --> <!-- Ensure all code can be tested offline (unmarked tests) and online (marked as 'integration') --> ## Additional context <!-- Add any other context about your changes here --> <!-- ## Breaking Changes --> <!-- List any breaking changes introduced by this PR and their implications and include '!' in the prefix. -->
## Description <!-- Prefix the PR title with 'feat:' to increment the minor version, or 'fix:' to increment the patch version --> <!-- Describe what changes this PR introduces and their effects --> <!-- Update documentation if there are any changes to existing features or APIs --> ## Testing <!-- Describe how you tested your changes and how reviewers can test them --> <!-- Ensure all code can be tested offline (unmarked tests) and online (marked as 'integration') --> ## Additional context <!-- Add any other context about your changes here --> <!-- ## Breaking Changes --> <!-- List any breaking changes introduced by this PR and their implications and include '!' in the prefix. -->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary by GPT-4
This commit makes several changes to the test suite for the GPT CLI:
- It refactors the test cases into data classes, making it easier to manage and understand the different test cases.
- It adds new test cases for different CLI options and error scenarios.
- It updates some of the existing test cases to use more descriptive variable names and improve readability.
- It adds new tests for running the CLI as a module, ensuring that it works correctly when invoked in this way.
Overall, these changes should make the test suite more robust and easier to maintain in the future.
Suggestions
Here are some suggestions for improving the changes in this PR:
- In
.github/workflows/python.yml
, update theactions/setup-python
version to the latest one (currently v3) instead of v4, which does not exist yet.
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v3
- In
tests/conftest.py
, add a docstring to themock_query
function for better readability.
def mock_query(self, question) -> MockQueryResponse:
"""
Mock query function for testing purposes.
"""
return MockQueryResponse()
- In
tests/test_gpt_cli.py
, consider adding comments to each group of test cases (e.g., ROOT_COMMANDS, ASK_COMMANDS, etc.) to provide a brief explanation of what they are testing.
Other than these minor suggestions, the changes in this PR look good and well-organized.
Codecov Report
@@ Coverage Diff @@
## main #69 +/- ##
==========================================
+ Coverage 89.14% 89.17% +0.02%
==========================================
Files 14 14
Lines 433 434 +1
Branches 65 65
==========================================
+ Hits 386 387 +1
Misses 34 34
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Description
Testing
Additional context