File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Tests for ContrastiveGenerator separate candidate provider support."""
22
3+ import sys
34from unittest .mock import patch , MagicMock
45
56
67from autochecklist .generators .instance_level .contrastive import ContrastiveGenerator
78
9+ # autochecklist.pipeline (module) is shadowed by the pipeline() function in __init__.py,
10+ # so we reference the module explicitly for patching
11+ _pipeline_module = sys .modules ["autochecklist.pipeline" ]
12+
813
914class TestGetCandidateClient :
1015 """Tests for _get_candidate_client() method."""
@@ -124,7 +129,7 @@ def test_generate_candidates_calls_candidate_client(self):
124129class TestPipelineThreadsCandidateParams :
125130 """Tests that pipeline() factory threads candidate_* params via generator_kwargs."""
126131
127- @patch ( "autochecklist.pipeline. get_generator" )
132+ @patch . object ( _pipeline_module , " get_generator" )
128133 def test_pipeline_passes_candidate_params_via_generator_kwargs (
129134 self , mock_get_generator
130135 ):
@@ -168,7 +173,7 @@ def method_name(self):
168173 assert init_kwargs ["candidate_api_key" ] == "sk-test"
169174 assert init_kwargs ["candidate_api_format" ] == "chat"
170175
171- @patch ( "autochecklist.pipeline. get_generator" )
176+ @patch . object ( _pipeline_module , " get_generator" )
172177 def test_pipeline_generator_kwargs_not_passed_without_them (
173178 self , mock_get_generator
174179 ):
You can’t perform that action at this time.
0 commit comments