@@ -175,8 +175,102 @@ def test_run_sync_dry_run(self, runner: TapTestRunner):
175175 assert result is True
176176 mock_tap .run_sync_dry_run .assert_called_once_with (
177177 dry_run_record_limit = runner .suite_config .max_records_limit ,
178+ streams = None ,
178179 )
179180
181+ def test_init_with_streams_parameter (self , mock_tap_class ):
182+ """Test TapTestRunner initialization with streams parameter."""
183+ config = {"test" : "config" }
184+ streams = ["users" , "orders" , "products" ]
185+
186+ runner = TapTestRunner (
187+ tap_class = mock_tap_class ,
188+ config = config ,
189+ streams = streams ,
190+ )
191+
192+ assert runner .streams == streams
193+ assert runner .singer_class is mock_tap_class
194+ assert runner .config == config
195+
196+ def test_init_with_streams_none (self , mock_tap_class ):
197+ """Test TapTestRunner initialization with streams=None."""
198+ runner = TapTestRunner (
199+ tap_class = mock_tap_class ,
200+ streams = None ,
201+ )
202+
203+ assert runner .streams is None
204+
205+ def test_init_with_streams_empty_sequence (self , mock_tap_class ):
206+ """Test TapTestRunner initialization with empty streams sequence."""
207+ runner = TapTestRunner (
208+ tap_class = mock_tap_class ,
209+ streams = [],
210+ )
211+
212+ assert runner .streams == []
213+
214+ def test_run_sync_dry_run_with_streams (self , mock_tap_class ):
215+ """Test run_sync_dry_run method with streams parameter."""
216+ streams = ["users" , "orders" ]
217+ runner = TapTestRunner (
218+ tap_class = mock_tap_class ,
219+ streams = streams ,
220+ )
221+
222+ mock_tap = Mock (spec = Tap )
223+ mock_tap .run_sync_dry_run .return_value = True
224+
225+ with patch .object (runner , "new_tap" , return_value = mock_tap ):
226+ result = runner .run_sync_dry_run ()
227+
228+ assert result is True
229+ mock_tap .run_sync_dry_run .assert_called_once_with (
230+ dry_run_record_limit = runner .suite_config .max_records_limit ,
231+ streams = streams ,
232+ )
233+
234+ def test_run_sync_dry_run_with_tuple_streams (self , mock_tap_class ):
235+ """Test run_sync_dry_run method with tuple streams parameter."""
236+ streams = ("users" , "orders" , "products" )
237+ runner = TapTestRunner (
238+ tap_class = mock_tap_class ,
239+ streams = streams ,
240+ )
241+
242+ mock_tap = Mock (spec = Tap )
243+ mock_tap .run_sync_dry_run .return_value = True
244+
245+ with patch .object (runner , "new_tap" , return_value = mock_tap ):
246+ result = runner .run_sync_dry_run ()
247+
248+ assert result is True
249+ mock_tap .run_sync_dry_run .assert_called_once_with (
250+ dry_run_record_limit = runner .suite_config .max_records_limit ,
251+ streams = streams ,
252+ )
253+
254+ def test_streams_parameter_with_other_kwargs (self , mock_tap_class ):
255+ """Test streams parameter works with other keyword arguments."""
256+ config = {"api_key" : "test" }
257+ suite_config = SuiteConfig (max_records_limit = 500 )
258+ streams = ["users" ]
259+ kwargs = {"parse_env_config" : True }
260+
261+ runner = TapTestRunner (
262+ tap_class = mock_tap_class ,
263+ config = config ,
264+ suite_config = suite_config ,
265+ streams = streams ,
266+ ** kwargs ,
267+ )
268+
269+ assert runner .streams == streams
270+ assert runner .config == config
271+ assert runner .suite_config is suite_config
272+ assert runner .default_kwargs == kwargs
273+
180274 def test_clean_sync_output (self ):
181275 """Test _clean_sync_output static method."""
182276 raw_output = """{"type": "SCHEMA", "stream": "test"}
@@ -535,6 +629,53 @@ def test_tap_runner_full_workflow(self):
535629 # Verify tap was created with correct config
536630 mock_tap_class .assert_called_with (config = config )
537631
632+ def test_tap_runner_with_streams_parameter (self ):
633+ """Test a complete tap runner workflow with streams parameter."""
634+ # Create a minimal mock tap that behaves more realistically
635+ mock_tap_class = Mock (spec = Tap )
636+ mock_tap_instance = Mock (spec = Tap )
637+ mock_tap_class .return_value = mock_tap_instance
638+
639+ # Configure realistic return values
640+ mock_tap_instance .run_discovery .return_value = '{"streams": []}'
641+ mock_tap_instance .run_connection_test .return_value = True
642+ mock_tap_instance .run_sync_dry_run .return_value = True
643+
644+ config = {"api_key" : "test_key" }
645+ suite_config = SuiteConfig (max_records_limit = 100 )
646+ streams = ["users" , "orders" ]
647+
648+ runner = TapTestRunner (
649+ tap_class = mock_tap_class ,
650+ config = config ,
651+ suite_config = suite_config ,
652+ streams = streams ,
653+ )
654+
655+ # Test that streams are stored correctly
656+ assert runner .streams == streams
657+
658+ # Test discovery (should not use streams)
659+ catalog = runner .run_discovery ()
660+ assert catalog == '{"streams": []}'
661+
662+ # Test connection (should not use streams)
663+ connection_ok = runner .run_connection_test ()
664+ assert connection_ok is True
665+
666+ # Test dry run (should pass streams parameter)
667+ dry_run_ok = runner .run_sync_dry_run ()
668+ assert dry_run_ok is True
669+
670+ # Verify tap was created with correct config
671+ mock_tap_class .assert_called_with (config = config )
672+
673+ # Verify that run_sync_dry_run was called with streams parameter
674+ mock_tap_instance .run_sync_dry_run .assert_called_once_with (
675+ dry_run_record_limit = 100 ,
676+ streams = streams ,
677+ )
678+
538679 def test_target_runner_with_real_input_data (self , tmp_path : Path ):
539680 """Test target runner with realistic input data."""
540681 # Create test input file
0 commit comments