mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-07-04 22:23:06 +02:00
- Add noqa: S603 for trusted internal C engine subprocess call - Add module docstring to conftest.py - Remove per-file ignores for engine.py and conftest.py from pyproject.toml
29 lines
873 B
Python
29 lines
873 B
Python
"""Pytest configuration and fixtures for lichess_bot tests."""
|
|
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
# Add repository root to sys.path so 'import python_pkg.*' works when running
|
|
# pytest with a subdirectory as rootdir.
|
|
ROOT = str(Path(__file__).resolve().parent.parent.parent.parent)
|
|
if ROOT not in sys.path:
|
|
sys.path.insert(0, ROOT)
|
|
|
|
|
|
def pytest_ignore_collect(collection_path: Path, config: pytest.Config) -> bool | None:
|
|
"""Ignore per-game blunder test files; keep only the unified one.
|
|
|
|
This lets us keep historical files in the repo without collecting them.
|
|
|
|
Args:
|
|
collection_path: Path being collected.
|
|
config: Pytest config object (unused).
|
|
"""
|
|
del config # unused
|
|
basename = collection_path.name
|
|
return bool(
|
|
basename.startswith("test_blunders_") and basename != "test_blunders_all.py"
|
|
)
|