--include-text-files on CLI raises DeprecationWarning.
(
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
)
| 168 | |
| 169 | |
| 170 | def test_include_text_files_cli_deprecated( |
| 171 | monkeypatch: pytest.MonkeyPatch, |
| 172 | capsys: pytest.CaptureFixture[str], |
| 173 | ) -> None: |
| 174 | """--include-text-files on CLI raises DeprecationWarning.""" |
| 175 | chunk = make_chunk("def foo(): pass", "src/foo.py") |
| 176 | fake_index = MagicMock() |
| 177 | fake_index.search.return_value = [SearchResult(chunk=chunk, score=0.9)] |
| 178 | monkeypatch.setattr(sys, "argv", ["semble", "search", "query", "/some/path", "--include-text-files"]) |
| 179 | with patch("semble.cli.SembleIndex.from_path", return_value=fake_index): |
| 180 | with warnings.catch_warnings(record=True) as caught: |
| 181 | warnings.simplefilter("always") |
| 182 | _cli_main() |
| 183 | assert any( |
| 184 | "include-text-files" in str(w.message).lower() for w in caught if issubclass(w.category, DeprecationWarning) |
| 185 | ) |
| 186 | |
| 187 | |
| 188 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected