Skip to content

Turn LettuceDetectDeprecationWarning into a test error #136

Closed

Description

@hslev

Parent: #134 · Epic: #126 · Blocked by: #135
Work on branch 134-see-one-consistent-warning-*; commit the changes and close the ticket.

Problem

New code must not call deprecated names. Without a pytest filter, nothing stops it, and the five existing test modules that call old names would break once the filter exists.

Current behavior

  • pyproject.toml:67 [tool.pytest.ini_options] has no filterwarnings. python_files = "test_*_pytest.py" at :69.
  • Test modules that call old names: tests/test_inference_pytest.py, tests/test_llm_detector_pytest.py, tests/test_llm_client_pytest.py, tests/test_custom_taxonomy_pytest.py, tests/test_factory_pytest.py.

Steps

  1. Add filterwarnings = ["error::lettucedetect.detectors._deprecation.LettuceDetectDeprecationWarning"] to the pytest config (or the importable path pytest accepts for the class).
  2. Add one module-level pytestmark = pytest.mark.filterwarnings("ignore::...LettuceDetectDeprecationWarning") to each of the five modules above. No other edit in them.
  3. Add a test that pytest.warns(LettuceDetectDeprecationWarning) still records the warning under the error filter.

Acceptance criteria

  • A test calling a stand-in deprecated name without a mark fails.
  • The five modules each have exactly one added mark and no other change.
  • pytest.warns still works; the full suite passes.

Start here

uv run --extra dev pytest tests -q

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions