Files
supervision/tests/test_public_api.py
T
75023c5f2f fix: remaining review findings in dataset, docs, and tests (#2416)
- Added `sv.mask_to_roi` as an explicit migration path for exclusive mask bounds
- Fixed COCO, CreateML, and Pascal VOC export validation to reject ambiguous or colliding dataset paths before writing
- Fixed in-memory `DetectionDataset` split and merge behavior
- Fixed `supervision` imports to avoid loading ByteTrack until it is used
- Fixed detection conversion helpers to support coordinate-convention migration while preserving legacy inclusive defaults
- Fixed Azure tag mapping, anchor rounding, and line-zone smoothing to avoid incorrect or ghost detections
- Fixed video processing shutdown handling for timeout and full-queue cases
- Improved downloader, validator, documentation, and regression coverage for the shipped dataset, detection, annotator, image, and video behavior

---------

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-08 23:00:32 +02:00

35 lines
1.1 KiB
Python

"""Guard that every symbol in supervision.__all__ is importable from the package."""
import pytest
import supervision as sv
@pytest.mark.parametrize(
"symbol_name",
[pytest.param(name, id=name) for name in sv.__all__],
)
def test_all_symbols_are_importable(symbol_name: str) -> None:
"""Every name in supervision.__all__ must be a non-None accessible attribute."""
if symbol_name == "ByteTrack":
sv.__dict__.pop("ByteTrack", None)
val = getattr(sv, symbol_name, None)
assert val is not None, (
f"supervision.{symbol_name} is listed in __all__ but not accessible "
f"as a non-None package attribute"
)
@pytest.mark.parametrize(
"symbol_name",
[
pytest.param("VLM", id="VLM"),
pytest.param("denormalize_boxes", id="denormalize_boxes"),
pytest.param("xyxyxyxy_to_xyxy", id="xyxyxyxy_to_xyxy"),
],
)
def test_shipped_imports_are_listed_in_all(symbol_name: str) -> None:
"""Public package attributes must be discoverable through __all__."""
assert getattr(sv, symbol_name) is not None
assert symbol_name in sv.__all__