yaml loading error: display relative path

This commit is contained in:
pared
2019-03-11 23:19:45 +01:00
parent cb10210572
commit 161d3ce7ef
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -212,6 +212,7 @@ class NoMetricsError(DvcException):
class StageFileCorruptedError(DvcException):
def __init__(self, path):
path = os.path.relpath(path)
super(StageFileCorruptedError, self).__init__(
"unable to read stage file: {} "
"YAML file structure is corrupted".format(path)
+1 -1
View File
@@ -415,7 +415,7 @@ class TestShouldThrowProperExceptionOnCorruptedStageFile(TestDvc):
ret = main(["add", self.FOO])
self.assertEqual(0, ret)
foo_stage = os.path.abspath(self.FOO + Stage.STAGE_FILE_SUFFIX)
foo_stage = os.path.relpath(self.FOO + Stage.STAGE_FILE_SUFFIX)
# corrupt stage file
with open(foo_stage, "a+") as file: