Skip to content

Commit 387e12c

Browse files
committed
fix: move edge-case tests to module level for pytest discovery
The existing test_qrs class uses lowercase naming which pytest's default collection does not pick up. Move the new empty-annotation tests to module level so they are actually discovered and run in CI.
1 parent 1a7c930 commit 387e12c

1 file changed

Lines changed: 32 additions & 24 deletions

File tree

tests/test_processing.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -200,32 +200,40 @@ def test_xqrs(self):
200200
assert comparitor.sensitivity > 0.99
201201
assert comparitor.positive_predictivity > 0.99
202202

203-
def test_compare_annotations_empty_ref(self):
204-
"""When reference annotations are empty, sensitivity should be NaN."""
205-
import math
203+
pass
206204

207-
comparitor = processing.compare_annotations(
208-
np.array([]), np.array([10, 20, 30]), 5
209-
)
210-
assert math.isnan(comparitor.sensitivity)
211-
assert comparitor.positive_predictivity == 0.0
212205

213-
def test_compare_annotations_empty_test(self):
214-
"""When test annotations are empty, PPV should be NaN."""
215-
import math
206+
# Module-level tests for empty-annotation edge cases (pytest collects these
207+
# directly, unlike the lowercase class above which is skipped by default).
216208

217-
comparitor = processing.compare_annotations(
218-
np.array([10, 20, 30]), np.array([]), 5
219-
)
220-
assert comparitor.sensitivity == 0.0
221-
assert math.isnan(comparitor.positive_predictivity)
209+
def test_compare_annotations_empty_ref():
210+
"""When reference annotations are empty, sensitivity should be NaN."""
211+
import math
222212

223-
def test_compare_annotations_both_empty(self):
224-
"""When both annotation arrays are empty, both metrics should be NaN."""
225-
import math
213+
comparitor = processing.compare_annotations(
214+
np.array([]), np.array([10, 20, 30]), 5
215+
)
216+
assert math.isnan(comparitor.sensitivity)
217+
assert comparitor.positive_predictivity == 0.0
226218

227-
comparitor = processing.compare_annotations(
228-
np.array([]), np.array([]), 5
229-
)
230-
assert math.isnan(comparitor.sensitivity)
231-
assert math.isnan(comparitor.positive_predictivity)
219+
220+
def test_compare_annotations_empty_test():
221+
"""When test annotations are empty, PPV should be NaN."""
222+
import math
223+
224+
comparitor = processing.compare_annotations(
225+
np.array([10, 20, 30]), np.array([]), 5
226+
)
227+
assert comparitor.sensitivity == 0.0
228+
assert math.isnan(comparitor.positive_predictivity)
229+
230+
231+
def test_compare_annotations_both_empty():
232+
"""When both annotation arrays are empty, both metrics should be NaN."""
233+
import math
234+
235+
comparitor = processing.compare_annotations(
236+
np.array([]), np.array([]), 5
237+
)
238+
assert math.isnan(comparitor.sensitivity)
239+
assert math.isnan(comparitor.positive_predictivity)

0 commit comments

Comments
 (0)