mirror of https://github.com/pypa/pip
Merge pull request #8759 from McSinyx/fix-test-py2-warn
Allow py2 deprecation warning from setuptools
This commit is contained in:
commit
5ef3dd1a54
|
@ -4,6 +4,7 @@ import textwrap
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from pip._vendor.six import PY2
|
||||||
|
|
||||||
from pip._internal.cli.status_codes import ERROR
|
from pip._internal.cli.status_codes import ERROR
|
||||||
from pip._internal.utils.urls import path_to_url
|
from pip._internal.utils.urls import path_to_url
|
||||||
|
@ -474,6 +475,7 @@ def make_wheel_with_python_requires(script, package_name, python_requires):
|
||||||
package_dir.joinpath('setup.py').write_text(text)
|
package_dir.joinpath('setup.py').write_text(text)
|
||||||
script.run(
|
script.run(
|
||||||
'python', 'setup.py', 'bdist_wheel', '--universal', cwd=package_dir,
|
'python', 'setup.py', 'bdist_wheel', '--universal', cwd=package_dir,
|
||||||
|
allow_stderr_warning=PY2,
|
||||||
)
|
)
|
||||||
|
|
||||||
file_name = '{}-1.0-py2.py3-none-any.whl'.format(package_name)
|
file_name = '{}-1.0-py2.py3-none-any.whl'.format(package_name)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import textwrap
|
||||||
from os.path import curdir, join, pardir
|
from os.path import curdir, join, pardir
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from pip._vendor.six import PY2
|
||||||
|
|
||||||
from pip._internal.cli.status_codes import ERROR, SUCCESS
|
from pip._internal.cli.status_codes import ERROR, SUCCESS
|
||||||
from pip._internal.models.index import PyPI, TestPyPI
|
from pip._internal.models.index import PyPI, TestPyPI
|
||||||
|
@ -1565,7 +1566,9 @@ def test_install_incompatible_python_requires_wheel(script, with_wheel):
|
||||||
version='0.1')
|
version='0.1')
|
||||||
"""))
|
"""))
|
||||||
script.run(
|
script.run(
|
||||||
'python', 'setup.py', 'bdist_wheel', '--universal', cwd=pkga_path)
|
'python', 'setup.py', 'bdist_wheel', '--universal',
|
||||||
|
cwd=pkga_path, allow_stderr_warning=PY2,
|
||||||
|
)
|
||||||
result = script.pip('install', './pkga/dist/pkga-0.1-py2.py3-none-any.whl',
|
result = script.pip('install', './pkga/dist/pkga-0.1-py2.py3-none-any.whl',
|
||||||
expect_error=True)
|
expect_error=True)
|
||||||
assert _get_expected_error_text() in result.stderr, str(result)
|
assert _get_expected_error_text() in result.stderr, str(result)
|
||||||
|
|
Loading…
Reference in New Issue