Skip to content

Several point-feature tests use bare except: pass, so a broken detector passes silently #51

Description

@petercorke

Found 2026-08-03 while adding regression tests for BRISK/AKAZE (see the opencv5 migration issue, #44). tests/test_image_point_features.py's test_sift, test_surf, test_orb, test_corners, and test_feature_properties all wrap the actual detector call in a bare try: ... except: pass. This means a completely broken detector (e.g. the exact AttributeError: BRISK_create not found bug fixed in #44) would make these tests pass silently instead of failing -- confirmed by construction while writing test_brisk/test_akaze without that pattern: reverting the BRISK/AKAZE fix makes the new tests fail loudly (as expected), but the same revert applied to SIFT/ORB would not be caught by the existing tests at all.

Fix

Remove the bare except: pass from these five tests; assert the real expected outcome directly (matching the pattern used for the new test_brisk/test_akaze). If a specific environment genuinely can't run one of these (e.g. SURF requiring a non-free build flag), skip explicitly with self.skipTest(reason) rather than swallowing all exceptions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtKnown technical debt / deferred cleanup, not a live bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions