summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStéphane Bidoul <stephane.bidoul@gmail.com>2023-03-18 12:48:42 +0100
committerStéphane Bidoul <stephane.bidoul@gmail.com>2023-03-29 08:41:09 +0200
commit93e6dd718483f248ff964ac797a4b422498813c2 (patch)
tree7351c80f4053adc546f625c89772580953f9a4f2 /tests
parent8f0201f67a7e4e2b60bd7e7aec4d5dbad17a867a (diff)
downloadpip-93e6dd718483f248ff964ac797a4b422498813c2.tar.gz
Remove now unused FormatControl in WheelCache
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_cache.py11
-rw-r--r--tests/unit/test_req.py5
2 files changed, 7 insertions, 9 deletions
diff --git a/tests/unit/test_cache.py b/tests/unit/test_cache.py
index f27daa266..d0fee69c3 100644
--- a/tests/unit/test_cache.py
+++ b/tests/unit/test_cache.py
@@ -4,13 +4,12 @@ from pathlib import Path
from pip._vendor.packaging.tags import Tag, interpreter_name, interpreter_version
from pip._internal.cache import WheelCache, _hash_dict
-from pip._internal.models.format_control import FormatControl
from pip._internal.models.link import Link
from pip._internal.utils.misc import ensure_dir
def test_falsey_path_none() -> None:
- wc = WheelCache("", FormatControl())
+ wc = WheelCache("")
assert wc.cache_dir is None
@@ -18,7 +17,7 @@ def test_subdirectory_fragment() -> None:
"""
Test the subdirectory URL fragment is part of the cache key.
"""
- wc = WheelCache("/tmp/.foo/", FormatControl())
+ wc = WheelCache("/tmp/.foo/")
link1 = Link("git+https://g.c/o/r#subdirectory=d1")
link2 = Link("git+https://g.c/o/r#subdirectory=d2")
assert wc.get_path_for_link(link1) != wc.get_path_for_link(link2)
@@ -29,7 +28,7 @@ def test_wheel_name_filter(tmpdir: Path) -> None:
Test the wheel cache filters on wheel name when several wheels
for different package are stored under the same cache directory.
"""
- wc = WheelCache(os.fspath(tmpdir), FormatControl())
+ wc = WheelCache(os.fspath(tmpdir))
link = Link("https://g.c/package.tar.gz")
cache_path = wc.get_path_for_link(link)
ensure_dir(cache_path)
@@ -57,7 +56,7 @@ def test_link_to_cache(tmpdir: Path) -> None:
Test that Link.from_json() produces Links with consistent cache
locations
"""
- wc = WheelCache(os.fspath(tmpdir), FormatControl())
+ wc = WheelCache(os.fspath(tmpdir))
# Define our expectations for stable cache path.
i_name = interpreter_name()
i_version = interpreter_version()
@@ -95,7 +94,7 @@ def test_link_to_cache(tmpdir: Path) -> None:
def test_get_cache_entry(tmpdir: Path) -> None:
- wc = WheelCache(os.fspath(tmpdir), FormatControl())
+ wc = WheelCache(os.fspath(tmpdir))
persi_link = Link("https://g.c/o/r/persi")
persi_path = wc.get_path_for_link(persi_link)
ensure_dir(persi_path)
diff --git a/tests/unit/test_req.py b/tests/unit/test_req.py
index c46883dc2..a5286c13a 100644
--- a/tests/unit/test_req.py
+++ b/tests/unit/test_req.py
@@ -25,7 +25,6 @@ from pip._internal.exceptions import (
from pip._internal.index.package_finder import PackageFinder
from pip._internal.metadata import select_backend
from pip._internal.models.direct_url import ArchiveInfo, DirectUrl, DirInfo, VcsInfo
-from pip._internal.models.format_control import FormatControl
from pip._internal.models.link import Link
from pip._internal.network.session import PipSession
from pip._internal.operations.build.build_tracker import get_build_tracker
@@ -403,7 +402,7 @@ class TestRequirementSet:
"""Test download_info hash is not set for an archive with legacy cache entry."""
url = shared_data.packages.joinpath("simple-1.0.tar.gz").as_uri()
finder = make_test_finder()
- wheel_cache = WheelCache(str(tmp_path / "cache"), FormatControl())
+ wheel_cache = WheelCache(str(tmp_path / "cache"))
cache_entry_dir = wheel_cache.get_path_for_link(Link(url))
Path(cache_entry_dir).mkdir(parents=True)
wheel.make_wheel(name="simple", version="1.0").save_to_dir(cache_entry_dir)
@@ -426,7 +425,7 @@ class TestRequirementSet:
url = shared_data.packages.joinpath("simple-1.0.tar.gz").as_uri()
hash = "sha256=ad977496000576e1b6c41f6449a9897087ce9da6db4f15b603fe8372af4bf3c6"
finder = make_test_finder()
- wheel_cache = WheelCache(str(tmp_path / "cache"), FormatControl())
+ wheel_cache = WheelCache(str(tmp_path / "cache"))
cache_entry_dir = wheel_cache.get_path_for_link(Link(url))
Path(cache_entry_dir).mkdir(parents=True)
Path(cache_entry_dir).joinpath("origin.json").write_text(