petercorke / petercorke/machinevision-toolbox-python
Several point-feature tests use bare except: pass, so a broken detector passes silently
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 219
- Forks
- 30
- Avg merge
- 12d 23h
- Merged PRs (30d)
- 5
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tests/test_image_point_features.py with test_sift, test_surf, test_orb, test_corners, and test_feature_properties, then compare them with test_brisk and test_akaze. Run the point-feature tests and make detector failures surface; where an environment genuinely cannot run a detector, verify that it is skipped explicitly with a reason rather than silently passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- opencv, python
- Domain
- computer-vision, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100