Add pytest coverage for video_processing, detection, and classification modules - #19
Merged
tkswanson merged 7 commits intoAug 20, 2026
Merged
Conversation
Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
…omments Co-authored-by: tkswanson <4371698+tkswanson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests for video detection and classification
Add pytest coverage for video_processing, detection, and classification modules
Aug 20, 2026
…video files - Replace invalid assertions that expect non-None for fake files - Add tests expecting None for corrupted/invalid video files - Add comprehensive mocked tests for valid video processing - Test both frames and fps parameters - Verify frame indices are within valid bounds - Test edge cases (zero frames, fps detection failure)
tkswanson
marked this pull request as ready for review
August 20, 2026 22:13
tkswanson
deleted the
copilot/add-tests-for-video-detection-classification
branch
August 20, 2026 22:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds missing test coverage for the three core inference modules (
video_processing,detection,classification), following the existing pytest structure and conftest stub pattern.New test files
tests/test_video_processing.py—get_images,get_videos,extract_frames(error cases, image-only, mixed, file output),_count_frames(missing file, frame list shape, fps mode)tests/test_detection.py—load_detector(missing file, model type),parse_detections(columns, empty detections, threshold filtering, manifest merge, error cases, file output),get_animals/get_empty(label + category int fallback),_convert_detections(no-detection path)tests/test_classification.py—load_classifier(with/without classes arg),load_class_list,classify(DataFrame/string/list inputs, missing column, file output, invalid input),single_classification(prediction column, empties,best=True, empty animals)conftest.py
Extended
_install_optional_stubs()to stubcv2when OpenCV is not installed, consistent with existingonnxruntimeandexiftoolstubs. The_FakeCapturereturns 30 frames at 10 FPS so video extraction tests run without real video files.