mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
[pre-commit.ci] pre-commit autoupdate (#9168)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.254 → v0.0.257](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.254...v0.0.257) - [github.com/codespell-project/codespell: v2.2.2 → v2.2.4](https://github.com/codespell-project/codespell/compare/v2.2.2...v2.2.4) * pre-commit: fix ruff errors * pre-commit: fix flake8 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: David de la Iglesia Castro <[email protected]>
This commit is contained in:
co-authored by
David de la Iglesia Castro
parent
f8bbf20b77
commit
48b56c83dc
@@ -620,7 +620,7 @@ def test_run_env(tmp_dir, dvc, scm, mocker):
|
||||
)
|
||||
dvc.experiments.run()
|
||||
assert (tmp_dir / "DVC_EXP_BASELINE_REV").read_text().strip() == baseline
|
||||
assert (tmp_dir / "DVC_EXP_NAME").read_text().strip() != ""
|
||||
assert (tmp_dir / "DVC_EXP_NAME").read_text().strip()
|
||||
assert (tmp_dir / "STUDIO_REPO_URL").read_text().strip() == "REPO_URL"
|
||||
|
||||
dvc.experiments.run(name="foo")
|
||||
|
||||
@@ -166,7 +166,7 @@ def test_when_params_is_omitted_in_interactive_mode(tmp_dir, scm, dvc):
|
||||
}
|
||||
}
|
||||
assert not (tmp_dir / "dvc.lock").exists()
|
||||
assert (tmp_dir / "script.py").read_text() == ""
|
||||
assert not (tmp_dir / "script.py").read_text()
|
||||
assert (tmp_dir / "data").is_dir()
|
||||
scm._reset()
|
||||
assert scm.is_tracked("dvc.yaml")
|
||||
@@ -194,7 +194,7 @@ def test_init_interactive_params_validation(tmp_dir, dvc, capsys):
|
||||
}
|
||||
}
|
||||
}
|
||||
assert (tmp_dir / "script.py").read_text() == ""
|
||||
assert not (tmp_dir / "script.py").read_text()
|
||||
assert (tmp_dir / "data").is_dir()
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
@@ -226,7 +226,7 @@ def test_init_with_no_defaults_interactive(tmp_dir, dvc):
|
||||
}
|
||||
}
|
||||
}
|
||||
assert (tmp_dir / "script.py").read_text() == ""
|
||||
assert not (tmp_dir / "script.py").read_text()
|
||||
assert (tmp_dir / "data").is_dir()
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ def test_init_default(tmp_dir, scm, dvc, interactive, overrides, inp, capsys):
|
||||
}
|
||||
}
|
||||
assert not (tmp_dir / "dvc.lock").exists()
|
||||
assert (tmp_dir / "script.py").read_text() == ""
|
||||
assert not (tmp_dir / "script.py").read_text()
|
||||
assert (tmp_dir / "data").is_dir()
|
||||
scm._reset()
|
||||
assert scm.is_tracked("dvc.yaml")
|
||||
@@ -345,7 +345,7 @@ def test_init_interactive_live(tmp_dir, scm, dvc, interactive, overrides, inp, c
|
||||
}
|
||||
}
|
||||
assert not (tmp_dir / "dvc.lock").exists()
|
||||
assert (tmp_dir / "script.py").read_text() == ""
|
||||
assert not (tmp_dir / "script.py").read_text()
|
||||
assert (tmp_dir / "data").is_dir()
|
||||
scm._reset()
|
||||
assert scm.is_tracked("dvc.yaml")
|
||||
|
||||
@@ -217,7 +217,7 @@ def test_get_url_positive(tmp_dir, erepo_dir, caplog, local_cloud):
|
||||
caplog.clear()
|
||||
with caplog.at_level(logging.ERROR, logger="dvc"):
|
||||
assert main(["get", os.fspath(erepo_dir), "foo", "--show-url"]) == 0
|
||||
assert caplog.text == ""
|
||||
assert not caplog.text
|
||||
|
||||
|
||||
def test_get_url_not_existing(tmp_dir, erepo_dir, caplog):
|
||||
|
||||
@@ -65,7 +65,7 @@ def test_init_quiet_should_not_display_welcome_screen(tmp_dir, scm, caplog):
|
||||
ret = main(["init", "--quiet"])
|
||||
|
||||
assert ret == 0
|
||||
assert caplog.text == ""
|
||||
assert not caplog.text
|
||||
|
||||
|
||||
def test_allow_init_dvc_subdir(tmp_dir, scm, monkeypatch):
|
||||
|
||||
@@ -27,7 +27,7 @@ def test_unlock_lock_failed(tmp_dir, dvc, request, mocker):
|
||||
# repro of a stage) in with. We should see LockError exception here.
|
||||
with lock:
|
||||
lock.unlock()
|
||||
lock_ext.lock() # imitate an exernal process had time to lock it
|
||||
lock_ext.lock() # imitate an external process had time to lock it
|
||||
request.addfinalizer(lock_ext.unlock)
|
||||
with pytest.raises(LockError):
|
||||
lock.lock()
|
||||
|
||||
@@ -200,13 +200,13 @@ class TestColorFormatter:
|
||||
|
||||
formatter.format(debug_record)
|
||||
captured = capsys.readouterr()
|
||||
assert captured.out == ""
|
||||
assert not captured.out
|
||||
|
||||
# when the message is actually visible
|
||||
with caplog.at_level(logging.INFO, logger="dvc"):
|
||||
logger.info("some info")
|
||||
captured = capsys.readouterr()
|
||||
assert captured.out == ""
|
||||
assert not captured.out
|
||||
|
||||
|
||||
def test_handlers():
|
||||
|
||||
@@ -9,8 +9,8 @@ def test_quiet_logging(caplog, capsys):
|
||||
for _ in Tqdm(range(10)):
|
||||
pass
|
||||
out_err = capsys.readouterr()
|
||||
assert out_err.out == ""
|
||||
assert out_err.err == ""
|
||||
assert not out_err.out
|
||||
assert not out_err.err
|
||||
|
||||
|
||||
def test_quiet_logging_disable_false(caplog, capsys, mocker):
|
||||
@@ -20,8 +20,8 @@ def test_quiet_logging_disable_false(caplog, capsys, mocker):
|
||||
for _ in Tqdm(range(10), disable=False):
|
||||
pass
|
||||
out_err = capsys.readouterr()
|
||||
assert out_err.out == ""
|
||||
assert out_err.err == ""
|
||||
assert not out_err.out
|
||||
assert not out_err.err
|
||||
|
||||
|
||||
def test_quiet_notty(caplog, capsys):
|
||||
@@ -29,11 +29,11 @@ def test_quiet_notty(caplog, capsys):
|
||||
for _ in Tqdm(range(10)):
|
||||
pass
|
||||
out_err = capsys.readouterr()
|
||||
assert out_err.out == ""
|
||||
assert not out_err.out
|
||||
if env2bool("DVC_IGNORE_ISATTY"):
|
||||
assert "0/10" in out_err.err
|
||||
else:
|
||||
assert out_err.err == ""
|
||||
assert not out_err.err
|
||||
|
||||
|
||||
def test_default(caplog, capsys, mocker):
|
||||
@@ -44,5 +44,5 @@ def test_default(caplog, capsys, mocker):
|
||||
pass
|
||||
|
||||
out_err = capsys.readouterr()
|
||||
assert out_err.out == ""
|
||||
assert not out_err.out
|
||||
assert "0/10" in out_err.err
|
||||
|
||||
@@ -34,8 +34,8 @@ def test_get_summary():
|
||||
del stats["modified"]
|
||||
assert get_summary(stats.items()) == "3 files added"
|
||||
|
||||
assert get_summary([]) == ""
|
||||
assert get_summary([("x", 0), ("y", [])]) == ""
|
||||
assert not get_summary([])
|
||||
assert not get_summary([("x", 0), ("y", [])])
|
||||
assert get_summary([("x", 1), ("y", [])]) == "1 file x"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user