(tmp_dir, dvc)
| 22 | |
| 23 | |
| 24 | def test_commit_force(tmp_dir, dvc): |
| 25 | tmp_dir.gen({"dir": {"file": "text1", "file2": "text2"}}) |
| 26 | (stage,) = dvc.add("dir", no_commit=True) |
| 27 | |
| 28 | assert stage.outs[0].changed_cache() |
| 29 | |
| 30 | tmp_dir.gen("dir/file", "file content modified") |
| 31 | |
| 32 | assert stage.outs[0].changed_cache() |
| 33 | |
| 34 | with pytest.raises(StageCommitError): |
| 35 | dvc.commit(stage.path) |
| 36 | |
| 37 | assert stage.outs[0].changed_cache() |
| 38 | |
| 39 | dvc.commit(stage.path, force=True) |
| 40 | assert dvc.status([stage.path]) == {} |
| 41 | |
| 42 | |
| 43 | def test_commit_preserve_fields(tmp_dir, dvc): |
nothing calls this directly
no test coverage detected