mirror of https://github.com/pypa/pip
fix code quality issues
This commit is contained in:
parent
6f7c304167
commit
004103c0f5
|
@ -1 +1 @@
|
|||
Fix a crash when ``sys.stdin`` is set to ``None``, such as on AWS Lambda.
|
||||
Fix a crash when ``sys.stdin`` is set to ``None``, such as on AWS Lambda.
|
||||
|
|
|
@ -1 +1 @@
|
|||
Fix a crash when ``sys.stdin`` is set to ``None``, such as on AWS Lambda.
|
||||
Fix a crash when ``sys.stdin`` is set to ``None``, such as on AWS Lambda.
|
||||
|
|
|
@ -10,9 +10,9 @@ import re
|
|||
from pip._internal.utils.logging import indent_log
|
||||
from pip._internal.utils.misc import (
|
||||
display_path,
|
||||
is_console_interactive,
|
||||
rmtree,
|
||||
split_auth_from_netloc,
|
||||
is_console_interactive
|
||||
split_auth_from_netloc
|
||||
)
|
||||
from pip._internal.utils.subprocess import make_command
|
||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||
|
|
|
@ -39,6 +39,7 @@ from pip._internal.utils.misc import (
|
|||
get_prog,
|
||||
hide_url,
|
||||
hide_value,
|
||||
is_console_interactive,
|
||||
normalize_path,
|
||||
normalize_version_info,
|
||||
parse_netloc,
|
||||
|
@ -49,8 +50,8 @@ from pip._internal.utils.misc import (
|
|||
rmtree,
|
||||
rmtree_errorhandler,
|
||||
split_auth_from_netloc,
|
||||
split_auth_netloc_from_url,
|
||||
is_console_interactive)
|
||||
split_auth_netloc_from_url
|
||||
)
|
||||
from pip._internal.utils.setuptools_build import make_setuptools_shim_args
|
||||
|
||||
|
||||
|
@ -977,23 +978,23 @@ def mock_stdin_isatty(monkeypatch, return_value):
|
|||
monkeypatch.setattr(sys.stdin, 'isatty', Mock(return_value=return_value))
|
||||
|
||||
|
||||
def test_is_console_interactive_when_stdin_is_none_and_isatty_true(monkeypatch):
|
||||
def test_is_console_interactive_when_stdin_none_and_isatty(monkeypatch):
|
||||
mock_stdin_isatty(monkeypatch, True)
|
||||
monkeypatch.setattr(sys, 'stdin', None)
|
||||
assert is_console_interactive() is False
|
||||
|
||||
|
||||
def test_is_console_interactive_when_stdin_is_none_and_isatty_false(monkeypatch):
|
||||
def test_is_console_interactive_when_stdin_none_and_not_isatty(monkeypatch):
|
||||
mock_stdin_isatty(monkeypatch, False)
|
||||
monkeypatch.setattr(sys, 'stdin', None)
|
||||
assert is_console_interactive() is False
|
||||
|
||||
|
||||
def test_is_console_interactive_when_stdin_is_not_none_and_isatty_true(monkeypatch):
|
||||
def test_is_console_interactive_when_stdin_isatty(monkeypatch):
|
||||
mock_stdin_isatty(monkeypatch, True)
|
||||
assert is_console_interactive() is True
|
||||
|
||||
|
||||
def test_is_console_interactive_when_stdin_is_not_none_and_isatty_false(monkeypatch):
|
||||
def test_is_console_interactive_when_stdin_not_isatty(monkeypatch):
|
||||
mock_stdin_isatty(monkeypatch, False)
|
||||
assert is_console_interactive() is False
|
||||
|
|
Loading…
Reference in New Issue