blob: d4dae369e9b7bfd4b47146dae4b283ce62ae54dd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# Author: cirakg & claude ai
# Summary: Shared pytest setup for the tool tests (import path, Hypothesis database).
"""Shared pytest setup for the tool tests.
* Makes the modules in tools/ importable as top-level modules.
* Keeps Hypothesis' example database in build/ (git-ignored) and disables its
per-example deadline, which is flaky on a busy machine.
"""
from __future__ import annotations
import sys
from pathlib import Path
from hypothesis import settings
from hypothesis.database import DirectoryBasedExampleDatabase
TOOLS_DIR = Path(__file__).resolve().parents[1]
PROJECT_ROOT = TOOLS_DIR.parent
sys.path.insert(0, str(TOOLS_DIR))
settings.register_profile(
"project",
database=DirectoryBasedExampleDatabase(str(PROJECT_ROOT / "build" / ".hypothesis")),
deadline=None,
)
settings.load_profile("project")
|