mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-13 04:25:32 +08:00
- hw/sim/tests/test_cam_perf.py: new cocotb perf test with bounded wait helpers - scripts/sweep_cam_perf.py: sweep data model, matrix, and make command builders - tests/test_sweep_cam_perf.py: unit tests for sweep helpers - tests/conftest.py: pytest path configuration for scripts package - hw/sim/Makefile: deterministic noise params override for perf test compatibility
22 lines
715 B
Python
22 lines
715 B
Python
"""pytest configuration — ensure ``scripts/`` is importable via package syntax.
|
||
|
||
The ``scripts`` directory is a PEP 420 implicit namespace package (no
|
||
``__init__.py``). Because ``uv run pytest`` does **not** add the project root
|
||
to ``sys.path``, ``from scripts.sweep_cam_perf import ...`` would otherwise
|
||
fail with ``ModuleNotFoundError``.
|
||
|
||
This conftest inserts the repository root at the front of ``sys.path`` so that
|
||
``scripts`` is discoverable as a top-level package.
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
_repo_root = Path(__file__).resolve().parent.parent
|
||
_repo_root_str = str(_repo_root)
|
||
|
||
if _repo_root_str not in sys.path:
|
||
sys.path.insert(0, _repo_root_str)
|