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