diff --git a/dvc/stage/run.py b/dvc/stage/run.py index ec2db8845c..4e33f96dfd 100644 --- a/dvc/stage/run.py +++ b/dvc/stage/run.py @@ -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 = ( diff --git a/tests/unit/stage/test_run.py b/tests/unit/stage/test_run.py new file mode 100644 index 0000000000..b0595051a1 --- /dev/null +++ b/tests/unit/stage/test_run.py @@ -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"] diff --git a/tests/unit/test_stage.py b/tests/unit/stage/test_stage.py similarity index 100% rename from tests/unit/test_stage.py rename to tests/unit/stage/test_stage.py