mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
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:
@@ -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 == "":
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user