import signal import sys from collections.abc import Iterator from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent)) @pytest.fixture(autouse=True) def _restore_sigint() -> Iterator[None]: """The UIs install their own SIGINT handler; keep pytest's.""" handler = signal.getsignal(signal.SIGINT) yield signal.signal(signal.SIGINT, handler)