Merge pull request #3075 from efiop/assert_stage

rwlock: check that .dvc/lock is locked
This commit is contained in:
Ruslan Kuprieiev
2020-01-08 00:44:32 +02:00
committed by GitHub
7 changed files with 23 additions and 8 deletions
+1 -1
View File
@@ -841,7 +841,7 @@ class TestReproExternalBase(TestDvc):
patch_run = patch.object(stage, "_run", wraps=stage._run)
with self.dvc.state:
with self.dvc.lock, self.dvc.state:
with patch_download as mock_download:
with patch_checkout as mock_checkout:
with patch_run as mock_run:
+2 -1
View File
@@ -655,7 +655,8 @@ def test_run_deterministic_overwrite(deterministic_run):
def test_run_deterministic_callback(deterministic_run):
deterministic_run.stage.remove()
with deterministic_run.stage.repo.lock:
deterministic_run.stage.remove()
deterministic_run.deps = []
deterministic_run.run()
with mock.patch("dvc.prompt.confirm", return_value=True):
+1 -1
View File
@@ -108,7 +108,7 @@ class TestDefaultWorkingDirectory(TestDvc):
d = load_stage_file(stage.relpath)
self.assertNotIn(Stage.PARAM_WDIR, d.keys())
with self.dvc.state:
with self.dvc.lock, self.dvc.state:
stage = Stage.load(self.dvc, stage.relpath)
self.assertFalse(stage.changed())