File size: 688 Bytes
a00fee9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Shared pytest fixtures and sys.path bootstrap for the test suite.

Ensures both the `api` package (repo root) and the `absa` package (src-layout)
are importable regardless of how pytest is invoked, so no ``PYTHONPATH``
environment hacks are required.
"""

from __future__ import annotations

import sys
from pathlib import Path

import pytest

_REPO_ROOT = Path(__file__).resolve().parent.parent
_SRC_DIR = _REPO_ROOT / "src"

for _path in (_REPO_ROOT, _SRC_DIR):
    if str(_path) not in sys.path:
        sys.path.insert(0, str(_path))


@pytest.fixture(autouse=True)
def _no_network() -> None:
    """Fixture placeholder for suite-wide guards (e.g. disable telemetry)."""
    yield