mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
metrics: pass --precision to _show_metrics (#5839)
* metrics: pass --precision to _show_metrics * tests: return empty string
This commit is contained in:
@@ -95,6 +95,7 @@ class CmdMetricsShow(CmdMetricsBase):
|
||||
self.args.all_branches,
|
||||
self.args.all_tags,
|
||||
self.args.all_commits,
|
||||
self.args.precision,
|
||||
)
|
||||
if table:
|
||||
logger.info(table)
|
||||
|
||||
@@ -111,16 +111,23 @@ def test_metrics_show(dvc, mocker):
|
||||
"--all-commits",
|
||||
"target1",
|
||||
"target2",
|
||||
"--precision",
|
||||
"8",
|
||||
]
|
||||
)
|
||||
assert cli_args.func == CmdMetricsShow
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch("dvc.repo.metrics.show.show", return_value={})
|
||||
m1 = mocker.patch("dvc.repo.metrics.show.show", return_value={})
|
||||
m2 = mocker.patch(
|
||||
"dvc.command.metrics._show_metrics",
|
||||
spec=_show_metrics,
|
||||
return_value="",
|
||||
)
|
||||
|
||||
assert cmd.run() == 0
|
||||
|
||||
m.assert_called_once_with(
|
||||
m1.assert_called_once_with(
|
||||
cmd.repo,
|
||||
["target1", "target2"],
|
||||
recursive=True,
|
||||
@@ -128,6 +135,14 @@ def test_metrics_show(dvc, mocker):
|
||||
all_branches=True,
|
||||
all_commits=True,
|
||||
)
|
||||
m2.assert_called_once_with(
|
||||
{},
|
||||
markdown=False,
|
||||
all_tags=True,
|
||||
all_branches=True,
|
||||
all_commits=True,
|
||||
precision=8,
|
||||
)
|
||||
|
||||
|
||||
def test_metrics_diff_precision():
|
||||
|
||||
Reference in New Issue
Block a user