mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
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:
@@ -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 = (
|
||||
|
||||
@@ -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"]
|
||||
Reference in New Issue
Block a user