mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 23:10:15 +01:00
dvc: change dvcfile.dump to do synchronized dump by default (#4544)
The API of `Dvcfile.dump` has been changed to `dump(stage, update_pipeline=True, update_lock=True)`, which will make it to always dump by default to both files, and provide flags to suppress one or the other. Fixes #4235
This commit is contained in:
@@ -242,7 +242,7 @@ def test_remove_stage_on_lockfile_format_error(tmp_dir, dvc, run_copy):
|
||||
dvc_file.remove_stage(stage)
|
||||
|
||||
lock_file.remove()
|
||||
dvc_file.dump(stage)
|
||||
dvc_file.dump(stage, update_pipeline=False)
|
||||
|
||||
dump_yaml(dvc_file.relpath, data)
|
||||
with pytest.raises(StageFileFormatError):
|
||||
@@ -312,7 +312,7 @@ def test_dvcfile_dump_preserves_meta(tmp_dir, dvc, run_copy):
|
||||
data["stages"]["run_copy"]["meta"] = metadata
|
||||
dump_yaml(dvcfile.path, data)
|
||||
|
||||
dvcfile.dump(stage, update_pipeline=True)
|
||||
dvcfile.dump(stage)
|
||||
assert dvcfile._load()[0] == data
|
||||
assert dvcfile._load()[0]["stages"]["run_copy"]["meta"] == metadata
|
||||
|
||||
@@ -332,5 +332,5 @@ def test_dvcfile_dump_preserves_comments(tmp_dir, dvc):
|
||||
stage.outs[0].use_cache = False
|
||||
dvcfile = stage.dvcfile
|
||||
|
||||
dvcfile.dump(stage, update_pipeline=True)
|
||||
dvcfile.dump(stage)
|
||||
assert dvcfile._load()[1] == (text + ":\n\tcache: false\n".expandtabs())
|
||||
|
||||
Reference in New Issue
Block a user