From 67248330c525fdb2dbc3d38539454e3ed2087570 Mon Sep 17 00:00:00 2001 From: jp Date: Sat, 25 Apr 2026 07:22:53 -0700 Subject: [PATCH] chore: ruff format tests/test_searcher.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI lint job runs `ruff format --check`; the new tests in TestBM25NoneSafety needed the standard "blank line after import-inside-function" + line-length wrap. No logic change — formatter pass only. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_searcher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_searcher.py b/tests/test_searcher.py index 51eb2f8..6b85832 100644 --- a/tests/test_searcher.py +++ b/tests/test_searcher.py @@ -138,17 +138,22 @@ class TestBM25NoneSafety: def test_tokenize_handles_none(self): from mempalace.searcher import _tokenize + assert _tokenize(None) == [] def test_tokenize_handles_empty_string(self): from mempalace.searcher import _tokenize + assert _tokenize("") == [] def test_bm25_scores_does_not_crash_on_none_documents(self): """A ``None`` mixed into the corpus must yield score 0.0 for that doc and finite scores for the rest, not raise AttributeError.""" from mempalace.searcher import _bm25_scores - scores = _bm25_scores("postgres migration", ["postgres migration done", None, "kafka rebalance"]) + + scores = _bm25_scores( + "postgres migration", ["postgres migration done", None, "kafka rebalance"] + ) assert len(scores) == 3 assert scores[1] == 0.0 assert scores[0] > 0.0