Skip to content

Commit 2290eab

Browse files
committed
test(GitSync.object) benchmark
1 parent c890ab2 commit 2290eab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/sync/test_git.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import typing as t
99

1010
import pytest
11+
from pytest_codspeed.plugin import BenchmarkFixture
1112
from pytest_mock import MockerFixture
1213

1314
from libvcs import exc
@@ -30,7 +31,6 @@
3031
ProjectTestFactoryRemoteLazyExpected = t.Callable[..., dict[str, GitRemote]]
3132

3233

33-
@pytest.mark.benchmark
3434
@pytest.mark.parametrize(
3535
# Postpone evaluation of options so fixture variables can interpolate
3636
("constructor", "lazy_constructor_options"),
@@ -57,6 +57,7 @@ def test_repo_git_obtain_initial_commit_repo(
5757
tmp_path: pathlib.Path,
5858
constructor: ProjectTestFactory,
5959
lazy_constructor_options: ProjectTestFactoryLazyKwargs,
60+
benchmark: BenchmarkFixture,
6061
) -> None:
6162
"""Initial commit repos return 'initial'.
6263
@@ -70,7 +71,7 @@ def test_repo_git_obtain_initial_commit_repo(
7071
bare_dir = tmp_path / repo_name
7172
git_repo: GitSync = constructor(**lazy_constructor_options(**locals()))
7273

73-
git_repo.obtain()
74+
benchmark(lambda: git_repo.obtain())
7475
assert git_repo.get_revision() == "initial"
7576

7677

0 commit comments

Comments
 (0)