Verify that process_video correctly propagates exceptions from the callback. Scenario: Processing a video where the callback raises an exception. Expected: `process_video` should propagate the exception, allowing users to handle errors during video processing.
(dummy_video_path, tmp_path)
| 27 | |
| 28 | |
| 29 | def test_process_video_exception_handling(dummy_video_path, tmp_path): |
| 30 | """ |
| 31 | Verify that process_video correctly propagates exceptions from the callback. |
| 32 | |
| 33 | Scenario: Processing a video where the callback raises an exception. |
| 34 | Expected: `process_video` should propagate the exception, allowing users to |
| 35 | handle errors during video processing. |
| 36 | """ |
| 37 | target_path = str(tmp_path / "target.mp4") |
| 38 | |
| 39 | def callback_with_exception(frame, index): |
| 40 | if index == 5: |
| 41 | raise ValueError("Test exception at frame 5") |
| 42 | return frame |
| 43 | |
| 44 | with pytest.raises(ValueError, match="Test exception at frame 5"): |
| 45 | process_video( |
| 46 | source_path=dummy_video_path, |
| 47 | target_path=target_path, |
| 48 | callback=callback_with_exception, |
| 49 | ) |
| 50 | |
| 51 | |
| 52 | def test_process_video_success(dummy_video_path, tmp_path): |
nothing calls this directly
no test coverage detected