Files
pipenv/tests/unit/test_core.py
T
Ethan Fulbright 118469db3b Add verbosity int variable, use capsys in test_core
Changed PIPENV_SUPPRESS_NESTED_WARNING to PIPENV_VERBOSITY, an integer
value that defaults to 0 (verbose).
Changed test in test_core.py to use capsys to capture standard
output/error in order to improve compatibility with Python 2.
2018-07-25 15:24:54 +08:00

16 lines
468 B
Python

import pytest
import mock
from pipenv.core import warn_in_virtualenv
@mock.patch('pipenv.environments.PIPENV_VIRTUALENV', 'totallyrealenv')
@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
# courtesy notice.
warn_in_virtualenv()
output, err = capsys.readouterr()
assert 'Courtesy Notice' not in err