Commit 31d4ab5
committed
Fix test skip condition for scikit-learn-extra tests
Problem:
- Tests in test_intensity_label_filter.py were failing on macOS CI
- The skip condition checked if import succeeded, but not if sklearn-extra was actually available
- Functions imported successfully but raised ImportError when called
Root Cause:
- Test was checking: 'try: import functions; HAS_KMEDOIDS = True'
- But functions exist even when sklearn-extra is missing
- Functions check _HAS_KMEDOIDS internally and raise ImportError at runtime
- Result: tests run when they should be skipped
Solution:
- Import _HAS_KMEDOIDS flag directly from the module
- Use this flag for @pytest.mark.skipif decorator
- Now tests properly skip when sklearn-extra is unavailable
Testing:
- All 171 tests still pass locally (with sklearn-extra installed)
- Tests will now properly skip on CI if sklearn-extra is missing
- Eliminates spurious failures on macOS GitHub Actions1 parent a3c0f93 commit 31d4ab5
1 file changed
Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
0 commit comments