Skip to content

Commit 914ccdb

Browse files
committed
cast to real WorkingSet in test metadata pkg resources
1 parent b3002e3 commit 914ccdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/unit/metadata/test_metadata_pkg_resources.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919

2020
pkg_resources = pytest.importorskip("pip._vendor.pkg_resources")
21-
21+
from pip._vendor.pkg_resources import WorkingSet
2222

2323
def _dist_is_local(dist: mock.Mock) -> bool:
2424
return dist.kind != "global" and dist.kind != "user"
@@ -71,13 +71,13 @@ def require(self, name: str) -> None:
7171
)
7272
def test_get_distribution(ws: _MockWorkingSet, req_name: str) -> None:
7373
"""Ensure get_distribution() finds all kinds of distributions."""
74-
dist = Environment(ws).get_distribution(req_name)
74+
dist = Environment(cast(WorkingSet, ws)).get_distribution(req_name)
7575
assert dist is not None
7676
assert cast(Distribution, dist)._dist.project_name == req_name
7777

7878

7979
def test_get_distribution_nonexist() -> None:
80-
dist = Environment(workingset).get_distribution("non-exist")
80+
dist = Environment(cast(WorkingSet, workingset)).get_distribution("non-exist")
8181
assert dist is None
8282

8383

0 commit comments

Comments
 (0)