mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 14:50:16 +00:00
Invert the verbosity flag (lower is less verbose)
This commit is contained in:
+2
-2
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user