supervision/tests/utils
Vikas saini 7239af5048
Refactor/remove asserts annotators image (#2354)
- ValueError → TypeError in all three ensure_*_image_for_* decorators (conversion.py): the decorator intercepts non-ndarray/PIL inputs before the wrapped body runs, so the inner raises were unreachable; fixing at the decorator level fixes all annotators at once
- Remove 5 dead isinstance guards from key_points/annotators.py and 4 from utils/image.py (all now covered by the decorator fix)
- Remove dead assert isinstance(scene, Image.Image) from RichLabelAnnotator.annotate (ensure_pil_image_for_class_method guarantees PIL.Image before inner body)
- Add @ensure_cv2_image_for_class_method to VertexLabelAnnotator.annotate for PIL parity (only decorated annotator missing it)
- Rewrite tests to call public API directly (no __wrapped__ bypass); replace with TestAnnotatorInputValidation class (parametrized, IDs, AAA) + parametrized test_image_utils_wrong_type_raises
- Add Raises: TypeError sections to all 6 annotator .annotate() docstrings, 4 image util docstrings, and 3 decorator docstrings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: jirka <6035284+Borda@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-06-26 17:51:01 +02:00
..
assets refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
__init__.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
conftest.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
test_conversion.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
test_file.py fix: normalize file extension filters (#2298) 2026-06-08 13:41:25 +02:00
test_image.py Refactor/remove asserts annotators image (#2354) 2026-06-26 17:51:01 +02:00
test_internal.py Revert "feat: store keypoints on detections (#2290)" (#2291) 2026-06-04 11:43:48 -06:00
test_iterables.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
test_logger.py feat: replace print statements with structured logging (#2154) 2026-02-20 13:14:53 +01:00
test_video.py fix: preserve audio stream in process_video (#2252) 2026-05-19 14:09:45 +02:00