tests: introduce dvc.testing

This is a very early version of test utils for dvc plugins. This module
consists of existing tests with minimal changes and is going to evolve
a lot as our plugins are getting filled in and pytest-test-utils matures.
This commit is contained in:
Ruslan Kuprieiev
2021-12-02 09:08:40 +02:00
parent 004e15c2c0
commit 09f48a5aaa
36 changed files with 1338 additions and 1009 deletions
+2 -2
View File
@@ -219,7 +219,7 @@ def test_auto_push_during_iterations(
):
# set up remote repo
remote = git_upstream.url if use_url else git_upstream.remote
git_upstream.scm.fetch_refspecs(str(tmp_dir), ["master:master"])
git_upstream.tmp_dir.scm.fetch_refspecs(str(tmp_dir), ["master:master"])
monkeypatch.setenv(DVC_EXP_GIT_REMOTE, remote)
auto_push_spy = mocker.spy(BaseExecutor, "_auto_push")
@@ -233,7 +233,7 @@ def test_auto_push_during_iterations(
assert (tmp_dir / "foo").read_text() == "4"
exp = first(results)
ref_info = first(exp_refs_by_rev(scm, exp))
assert git_upstream.scm.get_ref(str(ref_info)) == exp
assert git_upstream.tmp_dir.scm.get_ref(str(ref_info)) == exp
assert auto_push_spy.call_count == 2
assert auto_push_spy.call_args[0][2] == remote