diff --git a/tests/test_ml_suggestions.py b/tests/test_ml_suggestions.py index 0154eed..1074acd 100644 --- a/tests/test_ml_suggestions.py +++ b/tests/test_ml_suggestions.py @@ -25,10 +25,13 @@ def _img(sha: str, predictions: dict) -> ImageRecord: @pytest.mark.asyncio async def test_threshold_filters_low_confidence_general(db): + # Default general threshold is 0.50 (alembic 0029 lowered it from + # 0.95). Use 0.30/0.60 to keep the test asserting threshold behavior + # rather than the exact cutoff number. img = _img( "a" * 64, { - "smile": {"category": "general", "confidence": 0.80}, + "lowconf": {"category": "general", "confidence": 0.30}, "sword": {"category": "general", "confidence": 0.97}, }, ) @@ -37,7 +40,7 @@ async def test_threshold_filters_low_confidence_general(db): sl = await SuggestionService(db).for_image(img.id) names = [s.display_name for s in sl.by_category.get("general", [])] assert "sword" in names - assert "smile" not in names + assert "lowconf" not in names @pytest.mark.asyncio