"""Test-suite availability policy for locally supplied arcade ROM dumps.""" from pathlib import Path import pytest from galemu.roms import PROGRAM_ROM_SPECS ROM_DIRECTORY = Path(__file__).parents[1] / "rom" / "galaxian" def _program_roms_are_available() -> bool: return all((ROM_DIRECTORY / spec.filename).is_file() for spec in PROGRAM_ROM_SPECS) def pytest_collection_modifyitems(items: list[pytest.Item]) -> None: """Skip real-ROM evidence tests when a clone has no locally supplied dump.""" if _program_roms_are_available(): return skip_rom = pytest.mark.skip(reason="real Galaxian ROM dump is not available locally") for item in items: if item.get_closest_marker("rom") is not None: item.add_marker(skip_rom)