Skip to content

Commit 75332ac

Browse files
committed
Run black on tests/functional/test_fast_deps.py
1 parent b400ee3 commit 75332ac

File tree

1 file changed

+45
-30
lines changed

1 file changed

+45
-30
lines changed

tests/functional/test_fast_deps.py

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,87 @@
88

99
def pip(script, command, requirement):
1010
return script.pip(
11-
command, '--prefer-binary', '--no-cache-dir',
12-
'--use-feature=fast-deps', requirement,
11+
command,
12+
"--prefer-binary",
13+
"--no-cache-dir",
14+
"--use-feature=fast-deps",
15+
requirement,
1316
allow_stderr_warning=True,
1417
)
1518

1619

1720
def assert_installed(script, names):
18-
list_output = json.loads(script.pip('list', '--format=json').stdout)
19-
installed = {canonicalize_name(item['name']) for item in list_output}
21+
list_output = json.loads(script.pip("list", "--format=json").stdout)
22+
installed = {canonicalize_name(item["name"]) for item in list_output}
2023
assert installed.issuperset(map(canonicalize_name, names))
2124

2225

2326
@mark.network
24-
@mark.parametrize(('requirement', 'expected'), (
25-
('Paste==3.4.2', ('Paste', 'six')),
26-
('Paste[flup]==3.4.2', ('Paste', 'six', 'flup')),
27-
))
27+
@mark.parametrize(
28+
("requirement", "expected"),
29+
(
30+
("Paste==3.4.2", ("Paste", "six")),
31+
("Paste[flup]==3.4.2", ("Paste", "six", "flup")),
32+
),
33+
)
2834
def test_install_from_pypi(requirement, expected, script):
29-
pip(script, 'install', requirement)
35+
pip(script, "install", requirement)
3036
assert_installed(script, expected)
3137

3238

3339
@mark.network
34-
@mark.parametrize(('requirement', 'expected'), (
35-
('Paste==3.4.2', ('Paste-3.4.2-*.whl', 'six-*.whl')),
36-
('Paste[flup]==3.4.2', ('Paste-3.4.2-*.whl', 'six-*.whl', 'flup-*')),
37-
))
40+
@mark.parametrize(
41+
("requirement", "expected"),
42+
(
43+
("Paste==3.4.2", ("Paste-3.4.2-*.whl", "six-*.whl")),
44+
("Paste[flup]==3.4.2", ("Paste-3.4.2-*.whl", "six-*.whl", "flup-*")),
45+
),
46+
)
3847
def test_download_from_pypi(requirement, expected, script):
39-
result = pip(script, 'download', requirement)
48+
result = pip(script, "download", requirement)
4049
created = list(map(basename, result.files_created))
4150
assert all(fnmatch.filter(created, f) for f in expected)
4251

4352

4453
@mark.network
4554
def test_build_wheel_with_deps(data, script):
46-
result = pip(script, 'wheel', data.packages/'requiresPaste')
55+
result = pip(script, "wheel", data.packages / "requiresPaste")
4756
created = list(map(basename, result.files_created))
48-
assert fnmatch.filter(created, 'requiresPaste-3.1.4-*.whl')
49-
assert fnmatch.filter(created, 'Paste-3.4.2-*.whl')
50-
assert fnmatch.filter(created, 'six-*.whl')
57+
assert fnmatch.filter(created, "requiresPaste-3.1.4-*.whl")
58+
assert fnmatch.filter(created, "Paste-3.4.2-*.whl")
59+
assert fnmatch.filter(created, "six-*.whl")
5160

5261

5362
@mark.network
5463
def test_require_hash(script, tmp_path):
55-
reqs = tmp_path / 'requirements.txt'
64+
reqs = tmp_path / "requirements.txt"
5665
reqs.write_text(
57-
'idna==2.10'
58-
' --hash=sha256:'
59-
'b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0'
60-
' --hash=sha256:'
61-
'b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6'
66+
"idna==2.10"
67+
" --hash=sha256:"
68+
"b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"
69+
" --hash=sha256:"
70+
"b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
6271
)
6372
result = script.pip(
64-
'download', '--use-feature=fast-deps', '-r', str(reqs),
73+
"download",
74+
"--use-feature=fast-deps",
75+
"-r",
76+
str(reqs),
6577
allow_stderr_warning=True,
6678
)
6779
created = list(map(basename, result.files_created))
68-
assert fnmatch.filter(created, 'idna-2.10*')
80+
assert fnmatch.filter(created, "idna-2.10*")
6981

7082

7183
@mark.network
7284
def test_hash_mismatch(script, tmp_path):
73-
reqs = tmp_path / 'requirements.txt'
74-
reqs.write_text('idna==2.10 --hash=sha256:irna')
85+
reqs = tmp_path / "requirements.txt"
86+
reqs.write_text("idna==2.10 --hash=sha256:irna")
7587
result = script.pip(
76-
'download', '--use-feature=fast-deps', '-r', str(reqs),
88+
"download",
89+
"--use-feature=fast-deps",
90+
"-r",
91+
str(reqs),
7792
expect_error=True,
7893
)
79-
assert 'DO NOT MATCH THE HASHES' in result.stderr
94+
assert "DO NOT MATCH THE HASHES" in result.stderr

0 commit comments

Comments
 (0)