Skip to content

Commit f738897

Browse files
committed
test: fix progress bar mock to pass through batches
The test was not passing through the real batches, which prevented the lazy document capture from running. Updated mock to use side_effect to pass through the iterable while still allowing inspection of call args.
1 parent 9b3fef9 commit f738897

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/init_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,7 @@ def test_show_progress_controls_progress_bar(
555555
mock_model.requires_fence_output = False
556556
mock_create_model.return_value = mock_model
557557

558-
mock_progress_bar = mock.MagicMock()
559-
mock_progress_bar.__iter__ = mock.MagicMock(
560-
return_value=iter([mock.MagicMock()])
561-
)
562-
mock_progress.return_value = mock_progress_bar
558+
mock_progress.side_effect = lambda iterable, **kwargs: iter(iterable)
563559

564560
mock_examples = [
565561
lx.data.ExampleData(

0 commit comments

Comments
 (0)