Skip to content

Commit 66026ff

Browse files
author
Sergey Petrov
committed
chore(tests): wrap long with-patch lines in GPT-5 prefix tests
Four `with patch(...)` statements in the GPT-5 provider-prefix tests exceeded the repo's 120-character line limit (ruff line-length=120 in pyproject.toml). Wrap them onto multiple lines so the test file does not regress lint compliance for the newly added cases.
1 parent ba459fb commit 66026ff

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

tests/unittest/test_litellm_reasoning_effort.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,10 @@ async def test_gpt5_with_openai_prefix_triggers_reasoning_effort(self, monkeypat
704704
]
705705

706706
for model in prefixed_models:
707-
with patch('pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion', new_callable=AsyncMock) as mock_completion:
707+
with patch(
708+
'pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion',
709+
new_callable=AsyncMock,
710+
) as mock_completion:
708711
mock_completion.return_value = create_mock_acompletion_response()
709712

710713
handler = LiteLLMAIHandler()
@@ -728,7 +731,10 @@ async def test_gpt5_with_openai_prefix_strips_thinking_suffix(self, monkeypatch,
728731
fake_settings = create_mock_settings("low")
729732
monkeypatch.setattr(litellm_handler, "get_settings", lambda: fake_settings)
730733

731-
with patch('pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion', new_callable=AsyncMock) as mock_completion:
734+
with patch(
735+
'pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion',
736+
new_callable=AsyncMock,
737+
) as mock_completion:
732738
mock_completion.return_value = create_mock_acompletion_response()
733739

734740
handler = LiteLLMAIHandler()
@@ -748,7 +754,10 @@ async def test_gpt5_with_explicit_azure_prefix_preserves_routing(self, monkeypat
748754
fake_settings = create_mock_settings("medium")
749755
monkeypatch.setattr(litellm_handler, "get_settings", lambda: fake_settings)
750756

751-
with patch('pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion', new_callable=AsyncMock) as mock_completion:
757+
with patch(
758+
'pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion',
759+
new_callable=AsyncMock,
760+
) as mock_completion:
752761
mock_completion.return_value = create_mock_acompletion_response()
753762

754763
handler = LiteLLMAIHandler()
@@ -779,7 +788,10 @@ async def test_gpt5_in_azure_mode_does_not_stack_prefixes(self, monkeypatch, moc
779788
]
780789

781790
for input_model, expected in cases:
782-
with patch('pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion', new_callable=AsyncMock) as mock_completion:
791+
with patch(
792+
'pr_agent.algo.ai_handlers.litellm_ai_handler.acompletion',
793+
new_callable=AsyncMock,
794+
) as mock_completion:
783795
mock_completion.return_value = create_mock_acompletion_response()
784796

785797
handler = LiteLLMAIHandler()

0 commit comments

Comments
 (0)