Skip to content

chore: Replace @patch logger.warning with caplog fixture in credit_pool_service test#38626

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
DresdenGman:fix/logger-patch-to-caplog
Jul 10, 2026
Merged

chore: Replace @patch logger.warning with caplog fixture in credit_pool_service test#38626
asukaminato0721 merged 1 commit into
langgenius:mainfrom
DresdenGman:fix/logger-patch-to-caplog

Conversation

@DresdenGman

Copy link
Copy Markdown
Contributor

Replace patch("services.credit_pool_service.logger.warning") with caplog fixture in test_check_and_deduct_credits_logs_when_billing_release_fails.

  • Removed the @patch logger mock
  • Added caplog: pytest.LogCaptureFixture to function signature
  • Replaced logger_warning.assert_called_once() / call_args checks with caplog.records assertions

Refs #37468

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. refactor labels Jul 9, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 52.64% 52.64% +0.00%
Strict coverage 52.16% 52.16% +0.00%
Typed symbols 32,618 32,619 +1
Untyped symbols 29,619 29,619 0
Modules 2986 2986 0

@asukaminato0721 asukaminato0721 changed the title Replace @patch logger.warning with caplog fixture in credit_pool_service test chore: Replace @patch logger.warning with caplog fixture in credit_pool_service test Jul 10, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Jul 10, 2026
Merged via the queue into langgenius:main with commit faba726 Jul 10, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants