mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
fix issue with pytest-benchmark==5 (#10618)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
@@ -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",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user