[e988c2]: / tests / generative / conftest.py

Download this file

18 lines (10 with data), 414 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import sys
from .recording import recorder
__all__ = ["recorder"]
class BrokenDatabaseError(KeyboardInterrupt):
def __init__(self, database): # pragma: no cover
self.database = database
def pytest_keyboard_interrupt(excinfo): # pragma: no cover
if isinstance(excinfo.value, BrokenDatabaseError):
print(f"Unrecoverably broken {excinfo.value.database} database")
sys.exit(6)