提交 ac18393d 编写于 作者: C Chris Jerdonek

Make expect_stderr mean the weaker allow_stderr_warning.

上级 9efd2933
......@@ -1474,8 +1474,7 @@ def test_install_conflict_results_in_warning(script, data):
# Then install an incorrect version of the dependency
result2 = script.pip(
'install', '--no-index', pkgB_path,
expect_stderr=True,
'install', '--no-index', pkgB_path, allow_stderr_error=True,
)
assert "pkga 1.0 has requirement pkgb==1.0" in result2.stderr, str(result2)
assert "Successfully installed pkgB-2.0" in result2.stdout, str(result2)
......
......@@ -423,9 +423,9 @@ class PipTestEnvironment(TestFileEnvironment):
:param allow_stderr_error: whether a logged error is allowed in
stderr. Passing True for this argument implies
`allow_stderr_warning` since warnings are weaker than errors.
:param expect_stderr: allow any stderr (equivalent to passing
`allow_stderr_error`). This argument is an abbreviated version
of `allow_stderr_error` and is also kept for backwards
:param expect_stderr: whether to allow warnings in stderr (equivalent
to `allow_stderr_warning`). This argument is an abbreviated
version of `allow_stderr_warning` and is also kept for backwards
compatibility.
"""
if self.verbose:
......@@ -443,9 +443,12 @@ class PipTestEnvironment(TestFileEnvironment):
allow_stderr_error = kw.pop('allow_stderr_error', None)
allow_stderr_warning = kw.pop('allow_stderr_warning', None)
if kw.get('expect_error') or kw.get('expect_stderr'):
if kw.get('expect_error'):
# Then default to allowing logged errors.
allow_stderr_error = True
elif kw.get('expect_stderr'):
# Then default to allowing logged warnings.
allow_stderr_warning = True
# Pass expect_stderr=True to allow any stderr. We do this because
# we do our checking of stderr further on in check_stderr().
......
......@@ -140,7 +140,6 @@ class TestPipTestEnvironment:
self.run_stderr_with_prefix(script, prefix)
@pytest.mark.parametrize('arg_name', (
'expect_stderr',
'expect_error',
'allow_stderr_error',
))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册