ContentsFoundations to FrontierBezhig

eng-lab/labs/el01_hover/tests/_impl.py

All lab code. Download this file.

"""Loads the code under test.

By default the tests import YOUR files from eng-lab/hwe/core/ and read YOUR
design/requirements.toml and logs/tinker.csv. The ENGLAB_IMPL environment
variable points them at another folder instead, so a second implementation
can be run against the same tests. You never need to set it.
"""
import os
import sys
from pathlib import Path

LAB_DIR = Path(__file__).resolve().parents[1]
REPO = LAB_DIR.parents[1]                       # the eng-lab folder
if str(REPO) not in sys.path:
    sys.path.insert(0, str(REPO))

from hwe.core import load  # noqa: E402  (after the path fix above)

IMPL = os.environ.get("ENGLAB_IMPL")


def artifact(name: str, default: Path) -> Path:
    """A file the lab asks you to write (requirements, tinker log): yours, or ENGLAB_IMPL's."""
    return Path(IMPL) / name if IMPL else default