stage: fix --dry-run (#3799)

* tests: unit: move stage tests into a separate dir

* stage: fix --dry-run

Part of #3777
This commit is contained in:
Ruslan Kuprieiev
2020-05-14 20:19:34 +05:45
committed by GitHub
parent 1676a7a1cd
commit ff4fcc937b
3 changed files with 11 additions and 0 deletions
+1
View File
@@ -78,6 +78,7 @@ def cmd_run(stage, *args, **kwargs):
def run_stage(stage, dry=False, force=False, run_cache=False):
if dry:
logger.info("Running command:\n\t{}".format(stage.cmd))
return
stage_cache = stage.repo.stage_cache
stage_cached = (
+10
View File
@@ -0,0 +1,10 @@
import logging
from dvc.stage import Stage
from dvc.stage.run import run_stage
def test_run_stage_dry(caplog):
with caplog.at_level(level=logging.INFO, logger="dvc"):
run_stage(Stage(None, cmd="mycmd arg1 arg2"), dry=True)
assert caplog.messages == ["Running command:\n\tmycmd arg1 arg2"]