Skip to content

[BUG] Fix incorrect test expectations in blurring and contour detection tests #282

@alikhere

Description

@alikhere

Description:

Two test files have been testing the wrong things for a while and nobody caught it.

In test_blurring_operators.py, three tests are broken. The even-kernel tests for GaussianBlur and MedianBlur expect the operators to silently correct an even size to the next odd — that used to be the behaviour but both operators now just raise a ValueError instead. Same story with test_kernel_size_1_is_identity for MedianBlur, it passes kernelSize=1 but the validator rejects anything below 3. All three need to be rewritten to assert the error gets raised.

In test_contour_detection.py the parametrized test is passing color, retrieval_mode, and approximation_method as param keys but the operator actually reads rgbcolors_input, mode, and method. The wrong keys just get silently ignored so the tests were never actually hitting those code paths — they were passing for the wrong reason. One case also uses "LIST" as a mode value which doesn't exist in _MODE_MAP. On top of that the shape assertions in test_contour_detection_supports_gray_bgr_bgra are wrong — grayscale input comes out as BGR (H, W, 3) not (H, W), and BGRA comes out as BGRA (H, W, 4) not (H, W, 3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions