diff options
author | pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> | 2023-03-23 21:42:30 +0000 |
---|---|---|
committer | Stéphane Bidoul <stephane.bidoul@gmail.com> | 2023-04-10 16:45:34 +0200 |
commit | 4221c23a2bbd678cc3e41b4d84bad1a90cedc856 (patch) | |
tree | e38f423f3e99cf1a6892e1b70419a7262543fde2 /tests/unit/test_req_uninstall.py | |
parent | a84f7bf0b041ccf6d8ad88ad0dcd1a355f1ec156 (diff) | |
download | pip-4221c23a2bbd678cc3e41b4d84bad1a90cedc856.tar.gz |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Diffstat (limited to 'tests/unit/test_req_uninstall.py')
-rw-r--r-- | tests/unit/test_req_uninstall.py | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/tests/unit/test_req_uninstall.py b/tests/unit/test_req_uninstall.py index f990edc2b..b4ae97350 100644 --- a/tests/unit/test_req_uninstall.py +++ b/tests/unit/test_req_uninstall.py @@ -129,7 +129,11 @@ def test_compressed_listing(tmpdir: Path) -> None: class TestUninstallPathSet: def test_add(self, tmpdir: Path, monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr(pip._internal.req.req_uninstall.UninstallPathSet, "_permitted", mock_permitted) + monkeypatch.setattr( + pip._internal.req.req_uninstall.UninstallPathSet, + "_permitted", + mock_permitted, + ) # Fix case for windows tests file_extant = os.path.normcase(os.path.join(tmpdir, "foo")) file_nonexistent = os.path.normcase(os.path.join(tmpdir, "nonexistent")) @@ -145,7 +149,11 @@ class TestUninstallPathSet: assert ups._paths == {file_extant} def test_add_pth(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr(pip._internal.req.req_uninstall.UninstallPathSet, "_permitted", mock_permitted) + monkeypatch.setattr( + pip._internal.req.req_uninstall.UninstallPathSet, + "_permitted", + mock_permitted, + ) # Fix case for windows tests tmpdir = os.path.normcase(tmp_path) on_windows = sys.platform == "win32" @@ -175,7 +183,11 @@ class TestUninstallPathSet: @pytest.mark.skipif("sys.platform == 'win32'") def test_add_symlink(self, tmpdir: Path, monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr(pip._internal.req.req_uninstall.UninstallPathSet, "_permitted", mock_permitted) + monkeypatch.setattr( + pip._internal.req.req_uninstall.UninstallPathSet, + "_permitted", + mock_permitted, + ) f = os.path.join(tmpdir, "foo") with open(f, "w"): pass @@ -187,7 +199,11 @@ class TestUninstallPathSet: assert ups._paths == {foo_link} def test_compact_shorter_path(self, monkeypatch: pytest.MonkeyPatch) -> None: - monkeypatch.setattr(pip._internal.req.req_uninstall.UninstallPathSet, "_permitted", mock_permitted) + monkeypatch.setattr( + pip._internal.req.req_uninstall.UninstallPathSet, + "_permitted", + mock_permitted, + ) monkeypatch.setattr("os.path.exists", lambda p: True) # This deals with nt/posix path differences short_path = os.path.normcase( @@ -202,7 +218,11 @@ class TestUninstallPathSet: def test_detect_symlink_dirs( self, monkeypatch: pytest.MonkeyPatch, tmpdir: Path ) -> None: - monkeypatch.setattr(pip._internal.req.req_uninstall.UninstallPathSet, "_permitted", mock_permitted) + monkeypatch.setattr( + pip._internal.req.req_uninstall.UninstallPathSet, + "_permitted", + mock_permitted, + ) # construct 2 paths: # tmpdir/dir/file |