Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tests/func/utils/test_strict_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
3 │ cmd: python train.py

Found duplicate key "cmd" with value "python train.py" (original value:\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fit on a single line now?

Suggested change
Found duplicate key "cmd" with value "python train.py" (original value:\
Found duplicate key "cmd" with value "python train.py" (original value: "python

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably linters will complain though, black does not for some reason, hmm.

"python \ntrain.py"), in line 4, column 5
"python\ntrain.py"), in line 4, column 5
Copy link
Collaborator

@skshetry skshetry Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, if python moves above, this could be written as:

Suggested change
"python\ntrain.py"), in line 4, column 5
train.py"), in line 4, column 5

4 │ cmd: python train.py"""


Expand Down Expand Up @@ -161,8 +161,8 @@
NULL_VALUE_ON_OUTS_OUTPUT = """\
'./dvc.yaml' validation failed.

expected str, in stages -> stage1 -> outs -> 0 -> logs -> remote, line 6,\
column\n9
expected str, in stages -> stage1 -> outs -> 0 -> logs -> remote, line 6, \
column\n9
5 │ - logs:
6 │ │ cache: false
7 │ │ persist: true"""
Expand All @@ -180,7 +180,7 @@
ADDITIONAL_KEY_ON_OUTS_OUTPUT = """\
'./dvc.yaml' validation failed.

extra keys not allowed, in stages -> stage1 -> outs -> 0 -> logs -> \n\
extra keys not allowed, in stages -> stage1 -> outs -> 0 -> logs ->
not_existing_key, line 6, column 9
5 │ - logs:
6 │ │ cache: false
Expand Down Expand Up @@ -351,7 +351,13 @@ def print_with_fixed_width(*args, **kwargs):
out, err = capsys.readouterr()

assert not out
assert expected in err

# strip whitespace on the right: output is always left-justified
# by rich.syntax.Syntax:
for expected_line, err_line in zip(
expected.splitlines(), err.splitlines()
):
assert expected_line == err_line.rstrip(" ")


def test_make_relpath(tmp_dir, monkeypatch):
Expand Down