Skip to content

Commit 8704c7a

Browse files
remove unnecessary fixture
1 parent e27af2c commit 8704c7a

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

tests/functional/test_install.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import textwrap
88
from os.path import curdir, join, pardir
99
from pathlib import Path
10-
from typing import Callable, Dict, Iterable, List, Optional, Tuple
10+
from typing import Dict, Iterable, List, Optional, Tuple
1111

1212
import pytest
1313

@@ -2372,32 +2372,30 @@ def test_install_logs_pip_version_in_debug(
23722372
assert_re_match(pattern, result.stdout)
23732373

23742374

2375-
@pytest.fixture
23762375
def install_find_links(
23772376
script: PipTestEnvironment,
23782377
data: TestData,
2379-
) -> Callable[[Iterable[str], bool, Optional[Path]], TestPipResult]:
2380-
def install(
2381-
args: Iterable[str], dry_run: bool, target_dir: Optional[Path]
2382-
) -> TestPipResult:
2383-
return script.pip(
2384-
"install",
2385-
*(
2386-
(
2387-
"--target",
2388-
str(target_dir),
2389-
)
2390-
if target_dir is not None
2391-
else ()
2392-
),
2393-
*(("--dry-run",) if dry_run else ()),
2394-
"--no-index",
2395-
"--find-links",
2396-
data.find_links,
2397-
*args,
2398-
)
2399-
2400-
return install
2378+
args: Iterable[str],
2379+
*,
2380+
dry_run: bool,
2381+
target_dir: Optional[Path],
2382+
) -> TestPipResult:
2383+
return script.pip(
2384+
"install",
2385+
*(
2386+
(
2387+
"--target",
2388+
str(target_dir),
2389+
)
2390+
if target_dir is not None
2391+
else ()
2392+
),
2393+
*(("--dry-run",) if dry_run else ()),
2394+
"--no-index",
2395+
"--find-links",
2396+
data.find_links,
2397+
*args,
2398+
)
24012399

24022400

24032401
@pytest.mark.parametrize(
@@ -2406,8 +2404,8 @@ def install(
24062404
)
24072405
def test_install_dry_run_nothing_installed(
24082406
script: PipTestEnvironment,
2407+
data: TestData,
24092408
tmpdir: Path,
2410-
install_find_links: Callable[[Iterable[str], bool, Optional[Path]], TestPipResult],
24112409
with_target_dir: bool,
24122410
) -> None:
24132411
"""Test that pip install --dry-run logs what it would install, but doesn't actually
@@ -2418,7 +2416,9 @@ def test_install_dry_run_nothing_installed(
24182416
else:
24192417
install_dir = None
24202418

2421-
result = install_find_links(["simple"], True, install_dir)
2419+
result = install_find_links(
2420+
script, data, ["simple"], dry_run=True, target_dir=install_dir
2421+
)
24222422
assert "Would install simple-3.0" in result.stdout
24232423
assert "Successfully installed" not in result.stdout
24242424

@@ -2428,7 +2428,7 @@ def test_install_dry_run_nothing_installed(
24282428

24292429
# Ensure that the same install command would normally have worked if not for
24302430
# --dry-run.
2431-
install_find_links(["simple"], False, install_dir)
2431+
install_find_links(script, data, ["simple"], dry_run=False, target_dir=install_dir)
24322432
if with_target_dir:
24332433
assert os.listdir(install_dir)
24342434
else:

0 commit comments

Comments
 (0)