未验证 提交 d764181d 编写于 作者: P Pradyun Gedam 提交者: GitHub

Merge pull request #6933 from pradyunsg/misc/warning-cleanup

Move docstring to appropriately placed comment
......@@ -2,7 +2,6 @@ import textwrap
def test_environ(script, tmpdir):
"""$PYTHONWARNINGS was added in python2.7"""
demo = tmpdir.joinpath('warnings_demo.py')
demo.write_text(textwrap.dedent('''
from logging import basicConfig
......@@ -18,6 +17,7 @@ def test_environ(script, tmpdir):
expected = 'WARNING:pip._internal.deprecations:DEPRECATION: deprecated!\n'
assert result.stderr == expected
# $PYTHONWARNINGS was added in python2.7
script.environ['PYTHONWARNINGS'] = 'ignore'
result = script.run('python', demo)
assert result.stderr == ''
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册