19 lines
756 B
Python
19 lines
756 B
Python
|
|
"""Statische Prüfung mit ruff: unbenutzte Imports und undefinierte Namen fallen im Test auf, nicht erst im Review.
|
||
|
|
|
||
|
|
Anlass: bei der Fehlerdurchsicht am 18.09.2026 fand ruff 8 tote Imports und einen undefinierten Namen in einem
|
||
|
|
Testhelfer; nichts davon hatte ein Test bemerkt. Regeln in pyproject.toml ([tool.ruff.lint]).
|
||
|
|
"""
|
||
|
|
import subprocess
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
import pytest
|
||
|
|
|
||
|
|
ROOT = Path(__file__).resolve().parent.parent
|
||
|
|
|
||
|
|
|
||
|
|
def test_ruff_finds_nothing():
|
||
|
|
pytest.importorskip("ruff")
|
||
|
|
lauf = subprocess.run([sys.executable, "-m", "ruff", "check", "--no-cache", "--output-format", "concise", str(ROOT)],
|
||
|
|
capture_output=True, text=True, cwd=ROOT)
|
||
|
|
assert lauf.returncode == 0, lauf.stdout + lauf.stderr
|