import pytest

from kurier.core.basekurier import BaseKurier
from kurier.core.station import Station
from kurier.hermes import Hermes

Hermes.is_enabled = False


@pytest.fixture(autouse=True)
def clean_registries():
    """Clear all registries before and after each test."""
    Station.station_registry.clear()
    Station.event_registry.clear()
    BaseKurier._registry.clear()
    for subclass in BaseKurier.__subclasses__():
        subclass._registry.clear()

    yield

    Station.station_registry.clear()
    Station.event_registry.clear()
    BaseKurier._registry.clear()
    for subclass in BaseKurier.__subclasses__():
        subclass._registry.clear()
