fix issue with pytest-benchmark==5 (#10618)

This commit is contained in:
skshetry
2024-11-11 17:54:08 +05:45
committed by GitHub
parent 2431ec6189
commit 9a050684f7
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -150,7 +150,8 @@ def make_bench(request):
import pytest_benchmark.plugin
# hack from https://github.com/ionelmc/pytest-benchmark/issues/166
bench = pytest_benchmark.plugin.benchmark.__pytest_wrapped__.obj(request)
bench_gen = pytest_benchmark.plugin.benchmark.__pytest_wrapped__.obj(request)
bench = next(bench_gen)
suffix = f"-{name}"
@@ -172,7 +173,7 @@ def bench_dvc(request, dvc_bin, make_bench):
name = kwargs.pop("name", None)
name = f"-{name}" if name else ""
bench = make_bench(args[0] + name)
if request.config.getoption("--benchmark-cprofile-dump") or kwargs.pop(
if request.config.getoption("--dvc-benchmark-cprofile-dump") or kwargs.pop(
"cprofile", False
):
cprofile_results = request.config.invocation_params.dir / "prof"
+1 -1
View File
@@ -73,7 +73,7 @@ def pytest_addoption(parser):
)
parser.addoption(
"--benchmark-cprofile-dump",
"--dvc-benchmark-cprofile-dump",
action="store_true",
default=False,
help="Save cprofile results",
+1 -1
View File
@@ -99,7 +99,7 @@ s3 = ["dvc-s3>=3.2.0,<4"]
ssh = ["dvc-ssh>=4,<5"]
ssh_gssapi = ["dvc-ssh[gssapi]>=4,<5"]
testing = [
"pytest-benchmark[histogram]",
"pytest-benchmark[histogram]>=5,<6",
"pytest-test-utils",
"uv",
]