Invert the verbosity flag (lower is less verbose)

This commit is contained in:
Tzu-ping Chung
2018-07-25 15:28:55 +08:00
parent 7abd45f02d
commit cd82cdba63
3 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -1622,7 +1622,7 @@ def warn_in_virtualenv():
pipenv_active = os.environ.get("PIPENV_ACTIVE")
if (
(PIPENV_USE_SYSTEM or PIPENV_VIRTUALENV)
and not (pipenv_active or PIPENV_VERBOSITY > 0)
and not (pipenv_active or PIPENV_VERBOSITY < 0)
):
click.echo(
"{0}: Pipenv found itself running within a virtual environment, "
@@ -1633,7 +1633,7 @@ def warn_in_virtualenv():
"warning.".format(
crayons.green("Courtesy Notice"),
crayons.normal("PIPENV_IGNORE_VIRTUALENVS=1", bold=True),
crayons.normal("PIPENV_VERBOSITY=1", bold=True),
crayons.normal("PIPENV_VERBOSITY=-1", bold=True),
),
err=True,
)
+4 -3
View File
@@ -174,10 +174,11 @@ PIPENV_VENV_IN_PROJECT = bool(os.environ.get("PIPENV_VENV_IN_PROJECT"))
Default is to create new virtual environments in a global location.
"""
PIPENV_VERBOSITY = int(os.environ.get("PIPENV_VERBOSITY", "0"))
"""Verbosity setting for pipenv. Higher values make pipenv less verbose.
PIPENV_VERBOSITY = int(os.environ.get("PIPENV_VERBOSITY", 0))
"""Verbosity setting for pipenv.
Default is 0, for maximum verbosity.
Higher values make pipenv more verbose, lower values less so. Default is 0,
for normal verbosity.
"""
PIPENV_YES = bool(os.environ.get("PIPENV_YES"))
+1 -1
View File
@@ -5,7 +5,7 @@ from pipenv.core import warn_in_virtualenv
@mock.patch('pipenv.environments.PIPENV_VIRTUALENV', 'totallyrealenv')
@mock.patch('pipenv.environments.PIPENV_VERBOSITY', 1)
@mock.patch('pipenv.environments.PIPENV_VERBOSITY', -1)
@pytest.mark.core
def test_suppress_nested_venv_warning(capsys):
# Capture the stderr of warn_in_virtualenv to test for the presence of the