Skip to content

Commit 7d0c45b

Browse files
committed
chore: add simple benchmark
1 parent ddd9d2e commit 7d0c45b

File tree

6 files changed

+503
-0
lines changed

6 files changed

+503
-0
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,8 @@ match = "main"
159159
[tool.semantic_release.branches.noop]
160160
match = "(?!main$)"
161161
prerelease = true
162+
163+
[tool.uv]
164+
dev-dependencies = [
165+
"pytest-codspeed>=3.2.0",
166+
]

tests/benchmarks/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Benchmarks for testing the performance of the library."""

tests/benchmarks/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Benchmarks for testing the performance of the library."""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""Benchmarks."""
2+
3+
import pathlib
4+
5+
from pytest_codspeed import BenchmarkFixture
6+
7+
from annotatedyaml import load_yaml
8+
9+
FIXTURE_PATH = pathlib.Path(__file__).parent.parent.joinpath("fixtures")
10+
11+
12+
def test_simple_load(benchmark: BenchmarkFixture) -> None:
13+
"""Test loading a simple YAML file."""
14+
yaml_str = FIXTURE_PATH.joinpath("simple_automations.yaml").read_text()
15+
16+
@benchmark
17+
def _load_yaml() -> None:
18+
load_yaml(yaml_str)

0 commit comments

Comments
 (0)