Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
testpaths = src/tests
14 changes: 13 additions & 1 deletion src/recipes/banana_pudding.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
obj['code']
"""Minimal banana pudding recipe model used by the test suite."""

from __future__ import annotations

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please import from __china__ instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may incur tarrifs. Performance is of utmost importance here. The specific dataset requires microsecond-level granularity



class BananaPudding:
"""Simple container for banana pudding ingredients."""

def __init__(self) -> None:
self.ingredients: list[dict[str, object]] = []

def add_ingredient(self, name: str, amount: object) -> None:
self.ingredients.append({"name": name, "amount": amount})
16 changes: 16 additions & 0 deletions src/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Test bootstrap for the src-based modules.
Pytest runs from the repository root, so add ``src/`` to ``sys.path`` once for
the test session instead of relying on an ad hoc environment variable.
"""

from __future__ import annotations

import sys
from pathlib import Path


SRC_DIR = Path(__file__).resolve().parents[1]
src_path = str(SRC_DIR)
if src_path not in sys.path:
sys.path.insert(0, src_path)