Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Test test_commit_message_validator_failure had two @patch decorators but only accepted one mock parameter, causing a TypeError in CI.

Changes

  • Added mock_get_commit_info parameter to match the @patch("commit_check.engine.get_commit_info") decorator

When using multiple @patch decorators, pytest requires a parameter for each mock in bottom-to-top order:

@patch("commit_check.engine.get_commit_info")
@patch("commit_check.engine.has_commits")
@pytest.mark.benchmark
def test_commit_message_validator_failure(self, mock_has_commits, mock_get_commit_info):
    # Both mocks now properly injected

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Note

Free review on us!

CodeRabbit is offering free reviews until Wed Dec 17 2025 to showcase some of the refinements we've made.

Comment @coderabbitai help to get the list of available commands and usage tips.

The test_commit_message_validator_failure method had two @patch decorators
but only accepted one mock parameter, causing a TypeError in CI.
Added mock_get_commit_info parameter to match the decorators.

Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Copilot AI changed the title [WIP] Add comprehensive tests for configuration and validation fix(tests): Add missing mock parameter to test method signature Dec 15, 2025
Copilot AI requested a review from shenxianpeng December 15, 2025 02:56
@shenxianpeng shenxianpeng marked this pull request as ready for review December 15, 2025 06:14
@shenxianpeng shenxianpeng requested a review from a team as a code owner December 15, 2025 06:14
@shenxianpeng shenxianpeng merged commit 7bfef1f into feat/add-more-tests Dec 15, 2025
7 of 10 checks passed
@shenxianpeng shenxianpeng deleted the copilot/sub-pr-331 branch December 15, 2025 06:15
@sonarqubecloud
Copy link

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