diff --git a/screen_locker/tests/test_gate_select.py b/screen_locker/tests/test_gate_select.py index 05d95da..c352797 100644 --- a/screen_locker/tests/test_gate_select.py +++ b/screen_locker/tests/test_gate_select.py @@ -31,18 +31,21 @@ def _tree(root: Path) -> None: def test_transitive_import_reaches_test(tmp_path: Path) -> None: + """Selector: transitive import reaches test.""" _tree(tmp_path) got = gs.dart_affected_tests(tmp_path, [f"{APP}/lib/a.dart"]) assert got == [f"{APP}/test/c_test.dart"] def test_helper_followed_by_import(tmp_path: Path) -> None: + """Selector: helper followed by import.""" _tree(tmp_path) got = gs.dart_affected_tests(tmp_path, [f"{APP}/test/rig.dart"]) assert got == [f"{APP}/test/lonely_test.dart", f"{APP}/test/sub/x_test.dart"] def test_untouched_change_selects_nothing(tmp_path: Path) -> None: + """Selector: untouched change selects nothing.""" _tree(tmp_path) assert gs.dart_affected_tests(tmp_path, [f"{APP}/lib/lonely.dart"]) == [ f"{APP}/test/lonely_test.dart", @@ -52,6 +55,7 @@ def test_untouched_change_selects_nothing(tmp_path: Path) -> None: def test_pubspec_forces_full_and_says_why(tmp_path: Path) -> None: + """Selector: pubspec forces full and says why.""" _tree(tmp_path) sel = gs.select(tmp_path, [f"{APP}/pubspec.yaml", "web/x.ts"], []) assert sel.full_dart @@ -60,6 +64,7 @@ def test_pubspec_forces_full_and_says_why(tmp_path: Path) -> None: def test_python_mapping_and_full(tmp_path: Path) -> None: + """Selector: python mapping and full.""" tracked = [ "screen_locker/tests/test_foo_bar.py", "screen_locker/tests/test__foo.py", @@ -77,6 +82,7 @@ def test_python_mapping_and_full(tmp_path: Path) -> None: def test_no_web_without_web_files(tmp_path: Path) -> None: + """Selector: no web without web files.""" _tree(tmp_path) sel = gs.select(tmp_path, [f"{APP}/lib/a.dart"], []) assert not sel.web diff --git a/scripts/gate_changed_coverage.py b/scripts/gate_changed_coverage.py index 6ec340a..7e2dbab 100644 --- a/scripts/gate_changed_coverage.py +++ b/scripts/gate_changed_coverage.py @@ -8,8 +8,8 @@ loads would otherwise score 100% by absence). from __future__ import annotations -from pathlib import Path import logging +from pathlib import Path import sys _LOG = logging.getLogger(__name__) @@ -42,7 +42,11 @@ def main(argv: list[str]) -> int: uncovered(Path(argv[1]).read_text(encoding="utf-8"), wanted).items() ): if lines is None or lines: - _LOG.error("changed file below 100%%: %s (uncovered: %s)", path, "absent from lcov" if lines is None else lines) + _LOG.error( + "changed file below 100%%: %s (uncovered: %s)", + path, + "absent from lcov" if lines is None else lines, + ) bad += 1 return 1 if bad else 0