from __future__ import annotations import difflib def _ratio(a: str, b: str) -> int: return int(difflib.SequenceMatcher(a=a, b=b).ratio() * 100) def test_similarity_thresholds_behave_monotonically() -> None: """Similarity ratios should increase for more similar strings.""" a = "backend developer" b1 = "backend dev" b2 = "data engineer" assert _ratio(a, b1) > _ratio(a, b2)