mirror of https://github.com/pypa/pip
Run black on tests/functional/test_new_resolver_hashes.py
This commit is contained in:
parent
36877e327a
commit
13068687a7
|
@ -7,7 +7,8 @@ from pip._internal.utils.urls import path_to_url
|
|||
from tests.lib import create_basic_sdist_for_package, create_basic_wheel_for_package
|
||||
|
||||
_FindLinks = collections.namedtuple(
|
||||
"_FindLinks", "index_html sdist_hash wheel_hash",
|
||||
"_FindLinks",
|
||||
"index_html sdist_hash wheel_hash",
|
||||
)
|
||||
|
||||
|
||||
|
@ -75,9 +76,11 @@ def test_new_resolver_hash_intersect(script, requirements_template, message):
|
|||
"--no-cache-dir",
|
||||
"--no-deps",
|
||||
"--no-index",
|
||||
"--find-links", find_links.index_html,
|
||||
"--find-links",
|
||||
find_links.index_html,
|
||||
"-vv",
|
||||
"--requirement", requirements_txt,
|
||||
"--requirement",
|
||||
requirements_txt,
|
||||
)
|
||||
|
||||
assert message.format(name="base") in result.stdout, str(result)
|
||||
|
@ -107,10 +110,13 @@ def test_new_resolver_hash_intersect_from_constraint(script):
|
|||
"--no-cache-dir",
|
||||
"--no-deps",
|
||||
"--no-index",
|
||||
"--find-links", find_links.index_html,
|
||||
"--find-links",
|
||||
find_links.index_html,
|
||||
"-vv",
|
||||
"--constraint", constraints_txt,
|
||||
"--requirement", requirements_txt,
|
||||
"--constraint",
|
||||
constraints_txt,
|
||||
"--requirement",
|
||||
requirements_txt,
|
||||
)
|
||||
|
||||
message = (
|
||||
|
@ -138,7 +144,9 @@ def test_new_resolver_hash_intersect_from_constraint(script):
|
|||
ids=["both-requirements", "one-each"],
|
||||
)
|
||||
def test_new_resolver_hash_intersect_empty(
|
||||
script, requirements_template, constraints_template,
|
||||
script,
|
||||
requirements_template,
|
||||
constraints_template,
|
||||
):
|
||||
find_links = _create_find_links(script)
|
||||
|
||||
|
@ -163,9 +171,12 @@ def test_new_resolver_hash_intersect_empty(
|
|||
"--no-cache-dir",
|
||||
"--no-deps",
|
||||
"--no-index",
|
||||
"--find-links", find_links.index_html,
|
||||
"--constraint", constraints_txt,
|
||||
"--requirement", requirements_txt,
|
||||
"--find-links",
|
||||
find_links.index_html,
|
||||
"--constraint",
|
||||
constraints_txt,
|
||||
"--requirement",
|
||||
requirements_txt,
|
||||
expect_error=True,
|
||||
)
|
||||
|
||||
|
@ -193,8 +204,10 @@ def test_new_resolver_hash_intersect_empty_from_constraint(script):
|
|||
"--no-cache-dir",
|
||||
"--no-deps",
|
||||
"--no-index",
|
||||
"--find-links", find_links.index_html,
|
||||
"--constraint", constraints_txt,
|
||||
"--find-links",
|
||||
find_links.index_html,
|
||||
"--constraint",
|
||||
constraints_txt,
|
||||
"base==0.1.0",
|
||||
expect_error=True,
|
||||
)
|
||||
|
@ -208,7 +221,8 @@ def test_new_resolver_hash_intersect_empty_from_constraint(script):
|
|||
|
||||
@pytest.mark.parametrize("constrain_by_hash", [False, True])
|
||||
def test_new_resolver_hash_requirement_and_url_constraint_can_succeed(
|
||||
script, constrain_by_hash,
|
||||
script,
|
||||
constrain_by_hash,
|
||||
):
|
||||
wheel_path = create_basic_wheel_for_package(script, "base", "0.1.0")
|
||||
|
||||
|
@ -235,8 +249,10 @@ def test_new_resolver_hash_requirement_and_url_constraint_can_succeed(
|
|||
"install",
|
||||
"--no-cache-dir",
|
||||
"--no-index",
|
||||
"--constraint", constraints_txt,
|
||||
"--requirement", requirements_txt,
|
||||
"--constraint",
|
||||
constraints_txt,
|
||||
"--requirement",
|
||||
requirements_txt,
|
||||
)
|
||||
|
||||
script.assert_installed(base="0.1.0")
|
||||
|
@ -244,7 +260,8 @@ def test_new_resolver_hash_requirement_and_url_constraint_can_succeed(
|
|||
|
||||
@pytest.mark.parametrize("constrain_by_hash", [False, True])
|
||||
def test_new_resolver_hash_requirement_and_url_constraint_can_fail(
|
||||
script, constrain_by_hash,
|
||||
script,
|
||||
constrain_by_hash,
|
||||
):
|
||||
wheel_path = create_basic_wheel_for_package(script, "base", "0.1.0")
|
||||
other_path = create_basic_wheel_for_package(script, "other", "0.1.0")
|
||||
|
@ -272,8 +289,10 @@ def test_new_resolver_hash_requirement_and_url_constraint_can_fail(
|
|||
"install",
|
||||
"--no-cache-dir",
|
||||
"--no-index",
|
||||
"--constraint", constraints_txt,
|
||||
"--requirement", requirements_txt,
|
||||
"--constraint",
|
||||
constraints_txt,
|
||||
"--requirement",
|
||||
requirements_txt,
|
||||
expect_error=True,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue