mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 15:28:27 +01:00
plots: fix error when there are no plots in repo (#3940)
Consistent with `dvc metrics show/diff` behaviour. Fixes #3925
This commit is contained in:
@@ -14,7 +14,6 @@ from dvc.repo.plots.data import (
|
||||
PlotData,
|
||||
PlotMetricTypeError,
|
||||
)
|
||||
from dvc.repo.plots.show import NoDataOrTemplateProvided
|
||||
from dvc.repo.plots.template import (
|
||||
NoDataForTemplateError,
|
||||
NoFieldInDataError,
|
||||
@@ -457,8 +456,10 @@ def test_plot_override_specified_data_source(
|
||||
assert plot_content["encoding"]["y"]["field"] == "b"
|
||||
|
||||
|
||||
def test_should_raise_on_no_template_and_datafile(tmp_dir, dvc):
|
||||
with pytest.raises(NoDataOrTemplateProvided):
|
||||
def test_no_plots(tmp_dir, dvc):
|
||||
from dvc.exceptions import NoPlotsError
|
||||
|
||||
with pytest.raises(NoPlotsError):
|
||||
dvc.plots.show()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user