testsAndMisc/PYTHON/lichess_bot/tests/conftest.py
Krzysztof kuhy Rudnicki 4da77b6cfe fix(lint): remove FBT001/FBT002/FBT003 and ARG001/ARG002 from global ignores
FBT001/FBT002 fixes:
- Make boolean params keyword-only with *, syntax in:
  - stockfish_analysis/analyze_chess_game.py: pov_white
  - lichess_bot/main.py: decline_correspondence
  - screen_locker/screen_lock.py: demo_mode
- Update call sites to use keyword arguments

ARG001/ARG002 fixes:
- Prefix unused params with underscore:
  - extractLinks/main.py: tag -> _tag
  - lichess_bot/lichess_api.py: game_id -> _game_id
  - lichess_bot/tests/conftest.py: config -> _config

FBT003 per-file ignores (external API calls):
- PYTHON/keyboardCoop/main.py: pygame.font.render
- PYTHON/screen_locker/screen_lock.py: tkinter API
- poker-modifier-app/poker_modifier_app.py: tkinter API
2025-11-30 16:23:16 +01:00

23 lines
697 B
Python

import os
from pathlib import Path
import sys
import pytest
# Add repository root to sys.path so 'import PYTHON.*' works when running
# pytest with a subdirectory as rootdir.
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../.."))
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.
"""
basename = collection_path.name
return bool(
basename.startswith("test_blunders_") and basename != "test_blunders_all.py"
)