Solve check-ignore broken in a Linux pipeline (#4409)

fix #4407
1. Update test, now it can simulate a pipeline situation.
2. Solve remove `isatty` check in `dvc check-ignore --stdin` command.
This commit is contained in:
karajan1001
2020-08-17 16:17:45 +03:00
committed by GitHub
parent 1cfccef22e
commit b8e40f5091
2 changed files with 1 additions and 4 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ import logging
from dvc.command import completion
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
from dvc.prompt import ask
logger = logging.getLogger(__name__)
@@ -39,7 +38,7 @@ class CmdCheckIgnore(CmdBase):
ret = 1
while True:
try:
target = ask("")
target = input()
except (KeyboardInterrupt, EOFError):
break
if target == "":
-2
View File
@@ -130,8 +130,6 @@ def test_check_ignore_stdin_mode(
):
tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, "ignored")
mocker.patch("builtins.input", side_effect=[file, ""])
stdout_mock = mocker.patch("sys.stdout")
stdout_mock.isatty.return_value = True
assert main(["check-ignore", "--stdin"]) == ret
assert (file in caplog.text) is output