lint: re-enable E402; remove sys.path hacks; drop unused pytest imports in tests
Some checks failed
CI / Lint, test, and build (push) Failing after 46s

This commit is contained in:
ngxstat-bot 2025-08-16 05:24:14 -05:00
commit 5053a4c4db
4 changed files with 3 additions and 18 deletions

View file

@ -1,6 +1,3 @@
[flake8]
exclude = .git, .venv, output, static/icons
max-line-length = 160
per-file-ignores =
tests/test_*.py: E402

View file

@ -1,12 +1,6 @@
import sys
import json
import sqlite3
from pathlib import Path
import pytest # noqa: F401
REPO_ROOT = Path(__file__).resolve().parents[1]
sys.path.append(str(REPO_ROOT))
from scripts import analyze
from scripts import generate_reports as gr

View file

@ -1,9 +1,5 @@
import sys
from pathlib import Path
import pytest # noqa: F401
REPO_ROOT = Path(__file__).resolve().parents[1]
sys.path.append(str(REPO_ROOT))
from scripts import nginx_config as nc

View file

@ -1,14 +1,10 @@
import sqlite3
from pathlib import Path
import json
import sys
from datetime import datetime
import pytest
from typer.testing import CliRunner
REPO_ROOT = Path(__file__).resolve().parents[1]
sys.path.append(str(REPO_ROOT))
from scripts import generate_reports as gr
@ -205,7 +201,9 @@ def test_generate_root_index(tmp_path, sample_reports, monkeypatch):
def test_generated_marker_written(tmp_path, monkeypatch):
out_dir = tmp_path / "output"
monkeypatch.setattr(gr, "OUTPUT_DIR", out_dir)
monkeypatch.setattr(gr, "TEMPLATE_DIR", REPO_ROOT / "templates")
monkeypatch.setattr(
gr, "TEMPLATE_DIR", Path(__file__).resolve().parents[1] / "templates"
)
monkeypatch.setattr(gr, "GENERATED_MARKER", out_dir / "generated.txt")
monkeypatch.setattr(gr, "_copy_icons", lambda: None)
(out_dir / "hourly").mkdir(parents=True)