summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPradyun Gedam <pradyunsg@gmail.com>2023-03-27 20:03:11 +0100
committerGitHub <noreply@github.com>2023-03-27 20:03:11 +0100
commit78ab4cf071fcbda8af83d6b03be57c27a7008da7 (patch)
tree876a5b97363a54b1475e2faedebcb4f0fa2b8905 /tests
parent4a8693aa44138ea4da6d4088f6e273a3256ff876 (diff)
downloadpip-78ab4cf071fcbda8af83d6b03be57c27a7008da7.tar.gz
Bump all linters other than mypy (#11901)
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py1
-rw-r--r--tests/functional/test_build_env.py2
-rw-r--r--tests/functional/test_cache.py6
-rw-r--r--tests/functional/test_install.py1
-rw-r--r--tests/unit/test_base_command.py1
-rw-r--r--tests/unit/test_collector.py1
-rw-r--r--tests/unit/test_link.py2
-rw-r--r--tests/unit/test_network_cache.py1
-rw-r--r--tests/unit/test_options.py1
-rw-r--r--tests/unit/test_req_file.py1
-rw-r--r--tests/unit/test_utils.py1
-rw-r--r--tests/unit/test_wheel.py1
12 files changed, 6 insertions, 13 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 13011f4fd..57dd7e68a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -432,7 +432,6 @@ def virtualenv_template(
wheel_install: Path,
coverage_install: Path,
) -> Iterator[VirtualEnvironment]:
-
venv_type: VirtualEnvironmentType
if request.config.getoption("--use-venv"):
venv_type = "venv"
diff --git a/tests/functional/test_build_env.py b/tests/functional/test_build_env.py
index 93a6b930f..22a71cd32 100644
--- a/tests/functional/test_build_env.py
+++ b/tests/functional/test_build_env.py
@@ -106,7 +106,6 @@ def test_build_env_allow_only_one_install(script: PipTestEnvironment) -> None:
def test_build_env_requirements_check(script: PipTestEnvironment) -> None:
-
create_basic_wheel_for_package(script, "foo", "2.0")
create_basic_wheel_for_package(script, "bar", "1.0")
create_basic_wheel_for_package(script, "bar", "3.0")
@@ -206,7 +205,6 @@ def test_build_env_overlay_prefix_has_priority(script: PipTestEnvironment) -> No
@pytest.mark.usefixtures("enable_user_site")
def test_build_env_isolation(script: PipTestEnvironment) -> None:
-
# Create dummy `pkg` wheel.
pkg_whl = create_basic_wheel_for_package(script, "pkg", "1.0")
diff --git a/tests/functional/test_cache.py b/tests/functional/test_cache.py
index 7d20f5e31..788abdd2b 100644
--- a/tests/functional/test_cache.py
+++ b/tests/functional/test_cache.py
@@ -107,7 +107,7 @@ def list_matches_wheel(wheel_name: str, result: TestPipResult) -> bool:
`- foo-1.2.3-py3-none-any.whl `."""
lines = result.stdout.splitlines()
expected = f" - {wheel_name}-py3-none-any.whl "
- return any(map(lambda l: l.startswith(expected), lines))
+ return any(map(lambda line: line.startswith(expected), lines))
def list_matches_wheel_abspath(wheel_name: str, result: TestPipResult) -> bool:
@@ -121,7 +121,9 @@ def list_matches_wheel_abspath(wheel_name: str, result: TestPipResult) -> bool:
expected = f"{wheel_name}-py3-none-any.whl"
return any(
map(
- lambda l: os.path.basename(l).startswith(expected) and os.path.exists(l),
+ lambda line: (
+ os.path.basename(line).startswith(expected) and os.path.exists(line)
+ ),
lines,
)
)
diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py
index 97ccfa911..16ef572b5 100644
--- a/tests/functional/test_install.py
+++ b/tests/functional/test_install.py
@@ -2217,7 +2217,6 @@ def test_install_skip_work_dir_pkg(script: PipTestEnvironment, data: TestData) -
def test_install_verify_package_name_normalization(
script: PipTestEnvironment, package_name: str
) -> None:
-
"""
Test that install of a package again using a name which
normalizes to the original package name, is a no-op
diff --git a/tests/unit/test_base_command.py b/tests/unit/test_base_command.py
index 71a50fca6..daec5fc6c 100644
--- a/tests/unit/test_base_command.py
+++ b/tests/unit/test_base_command.py
@@ -22,7 +22,6 @@ def fixed_time() -> Iterator[None]:
class FakeCommand(Command):
-
_name = "fake"
def __init__(
diff --git a/tests/unit/test_collector.py b/tests/unit/test_collector.py
index 47307c00e..26a2ce4b9 100644
--- a/tests/unit/test_collector.py
+++ b/tests/unit/test_collector.py
@@ -1014,6 +1014,7 @@ def test_link_collector_create_find_links_expansion(
"""
Test "~" expansion in --find-links paths.
"""
+
# This is a mock version of expanduser() that expands "~" to the tmpdir.
def expand_path(path: str) -> str:
if path.startswith("~/"):
diff --git a/tests/unit/test_link.py b/tests/unit/test_link.py
index df4957d59..311be5888 100644
--- a/tests/unit/test_link.py
+++ b/tests/unit/test_link.py
@@ -108,7 +108,7 @@ class TestLink:
)
def test_invalid_egg_fragments(self, fragment: str) -> None:
url = f"git+https://example.com/package#egg={fragment}"
- with pytest.raises(Exception):
+ with pytest.raises(ValueError):
Link(url)
@pytest.mark.parametrize(
diff --git a/tests/unit/test_network_cache.py b/tests/unit/test_network_cache.py
index 8764b1343..a5519864f 100644
--- a/tests/unit/test_network_cache.py
+++ b/tests/unit/test_network_cache.py
@@ -24,7 +24,6 @@ class TestSafeFileCache:
"""
def test_cache_roundtrip(self, cache_tmpdir: Path) -> None:
-
cache = SafeFileCache(os.fspath(cache_tmpdir))
assert cache.get("test key") is None
cache.set("test key", b"a test string")
diff --git a/tests/unit/test_options.py b/tests/unit/test_options.py
index 39396512a..9e3a0a5d6 100644
--- a/tests/unit/test_options.py
+++ b/tests/unit/test_options.py
@@ -454,7 +454,6 @@ class TestCountOptions(AddFakeCommandMixin):
class TestGeneralOptions(AddFakeCommandMixin):
-
# the reason to specifically test general options is due to the
# extra processing they receive, and the number of bugs we've had
diff --git a/tests/unit/test_req_file.py b/tests/unit/test_req_file.py
index 30cbcf71c..be369f1a0 100644
--- a/tests/unit/test_req_file.py
+++ b/tests/unit/test_req_file.py
@@ -613,7 +613,6 @@ class TestBreakOptionsArgs:
class TestOptionVariants:
-
# this suite is really just testing optparse, but added it anyway
def test_variant1(
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
index 1daaecbf4..a67a7c110 100644
--- a/tests/unit/test_utils.py
+++ b/tests/unit/test_utils.py
@@ -53,7 +53,6 @@ class Tests_EgglinkPath:
"util.egg_link_path_from_location() tests"
def setup_method(self) -> None:
-
project = "foo"
self.mock_dist = Mock(project_name=project)
diff --git a/tests/unit/test_wheel.py b/tests/unit/test_wheel.py
index c5a8f3be4..059f382b2 100644
--- a/tests/unit/test_wheel.py
+++ b/tests/unit/test_wheel.py
@@ -518,7 +518,6 @@ class TestInstallUnpackedWheel:
class TestMessageAboutScriptsNotOnPATH:
-
tilde_warning_msg = (
"NOTE: The current PATH contains path(s) starting with `~`, "
"which may not be expanded by all applications."