Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
myname committed Apr 19, 2020
1 parent 224b0fc commit d2e6835
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dvc/scm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,7 @@ def belongs_to_scm(self, path):

def close(self):
""" Method to close the files """

def resolve_rev(self, rev):
"""Pick out and massage parameters"""
raise SCMError("only supported for Git repositories")
11 changes: 11 additions & 0 deletions tests/func/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,3 +1005,14 @@ def test_metrics_diff_deleted_metric(tmp_dir, scm, dvc):
"a.b.e": {"old": "3", "new": None},
}
}


def test_metrics_without_scm(tmp_dir, dvc):
metrics = {"acc": 0.97, "recall": 0.95}
metrics_name = "metrics.json"
tmp_dir.gen({metrics_name: json.dumps(metrics)})
dvc.add(metrics_name)
dvc.metrics.add(metrics_name)
with pytest.raises(DvcException) as msg:
dvc.metrics.diff()
assert "only supported for Git repositories" in str(msg.value)

0 comments on commit d2e6835

Please sign in to comment.