[pre-commit.ci] pre-commit autoupdate (#10663)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot]
2025-01-09 21:49:48 +05:45
committed by GitHub
parent aea0e6b6cc
commit e70a1e9bfc
14 changed files with 26 additions and 40 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ def test_hydra_sweep_prefix_name(tmp_dir, params_repo, dvc):
db_values = ["mysql", "postgresql"]
param = "+db=" + ",".join(db_values)
dvc.experiments.run(params=[param], queue=True, name=prefix)
expected_names = [f"{prefix}-{i+1}" for i, _ in enumerate(db_values)]
expected_names = [f"{prefix}-{i + 1}" for i, _ in enumerate(db_values)]
exp_names = [entry.name for entry in dvc.experiments.celery_queue.iter_queued()]
for name, expected in zip(exp_names, expected_names):
assert name == expected
+2 -5
View File
@@ -205,11 +205,8 @@ def test_plots_show_nested_x_dict(tmp_dir, dvc, scm):
dvclive_metrics_dir.gen(
{
"Error.tsv": "step\tError\n" "0\t0.11\n" "1\t0.22\n" "2\t0.44\n",
"Max_Leaf_Nodes.tsv": "step\tMax_Leaf_Nodes\n"
"0\t5\n"
"1\t50\n"
"2\t500\n",
"Error.tsv": "step\tError\n0\t0.11\n1\t0.22\n2\t0.44\n",
"Max_Leaf_Nodes.tsv": "step\tMax_Leaf_Nodes\n0\t5\n1\t50\n2\t500\n",
}
)
+1 -1
View File
@@ -132,7 +132,7 @@ def test_merge_different_output_options(tmp_dir, dvc, caplog):
)
(tmp_dir / "their").write_text(
"outs:\n"
r"outs:\n"
"- md5: f987654321.dir\n"
" hash: md5\n"
" path: path\n"
+6 -6
View File
@@ -114,13 +114,13 @@ def assert_index_equal(first, second, strict=True, ordered=True):
assert len(first) == len(second), "Index have different no. of stages"
assert set(first) == set(second), "Index does not have same stages"
if ordered:
assert list(first) == list(
second
), "Index does not have same sequence of stages"
assert list(first) == list(second), (
"Index does not have same sequence of stages"
)
if strict:
assert set(map(id, first)) == set(
map(id, second)
), "Index is not strictly equal"
assert set(map(id, first)) == set(map(id, second)), (
"Index is not strictly equal"
)
def test_skip_graph_checks(dvc, mocker):
+2 -5
View File
@@ -553,11 +553,8 @@ def test_nested_x_defn_collection(tmp_dir, dvc, scm, capsys):
)
dvclive_metrics_dir.gen(
{
"Error.tsv": "step\tError\n" "0\t0.11\n" "1\t0.22\n" "2\t0.44\n",
"Max_Leaf_Nodes.tsv": "step\tMax_Leaf_Nodes\n"
"0\t5\n"
"1\t50\n"
"2\t500\n",
"Error.tsv": "step\tError\n0\t0.11\n1\t0.22\n2\t0.44\n",
"Max_Leaf_Nodes.tsv": "step\tMax_Leaf_Nodes\n0\t5\n1\t50\n2\t500\n",
}
)
(other_logger_dir / "multiple_metrics.json").dump(
+1 -1
View File
@@ -106,7 +106,7 @@ def test_add_already_exists(dvc, caplog, mocker):
"missing": "Updating mydataset (s3://bucket/path)\n",
"unchanged": "Nothing to update\n",
"updated": (
"Updating mydataset (s3://bucket/path)\n"
r"Updating mydataset (s3://bucket/path)\n"
"M\tbaz\n"
"A\tfoobar\n"
"D\tfoo\n"
+3 -3
View File
@@ -123,6 +123,6 @@ def test_info_on_subrepos(make_tmp_dir, tmp_dir, dvc, scm, dvcfs):
for path in ["subrepo", "subrepo/foo", "subrepo/foobar"]:
info = dvcfs.info(path)
assert info["repo"].root_dir == str(
subrepo
), f"repo root didn't match for {path}"
assert info["repo"].root_dir == str(subrepo), (
f"repo root didn't match for {path}"
)
+1 -2
View File
@@ -130,6 +130,5 @@ def test_feature_section_supports_arbitrary_values(caplog):
assert "random_key_1" not in data
assert "random_key_2" not in data
assert (
"'feature.random_key_1', 'feature.random_key_2' "
"config options are unsupported"
"'feature.random_key_1', 'feature.random_key_2' config options are unsupported"
) in caplog.text
+2 -6
View File
@@ -104,9 +104,7 @@ class TestColorFormatter:
logger.exception("")
expected = (
"{red}{datetime}{nc} "
"{red}ERROR{nc}: description\n"
"{stack_trace}".format(
"{red}{datetime}{nc} {red}ERROR{nc}: description\n{stack_trace}".format(
stack_trace=stack_trace,
**colors,
datetime=dt,
@@ -144,9 +142,7 @@ class TestColorFormatter:
logger.exception("something", extra={"tb_only": True})
expected = (
"{red}{datetime}{nc} "
"{red}ERROR{nc}: something\n"
"{stack_trace}".format(
"{red}{datetime}{nc} {red}ERROR{nc}: something\n{stack_trace}".format(
stack_trace=stack_trace,
**colors,
datetime=dt,