mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-26 23:09:35 +01:00
Merge pull request #3075 from efiop/assert_stage
rwlock: check that .dvc/lock is locked
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user