Skip to content

Commit 5a3c412

Browse files
committed
pylock: remove unused attribute
1 parent 06551ae commit 5a3c412

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/pip/_internal/models/pylock.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ class PylockValidationError(Exception):
209209
class PylockRequiredKeyError(PylockValidationError):
210210
def __init__(self, key: str) -> None:
211211
super().__init__(f"Missing required key {key!r}")
212-
self.key = key
213212

214213

215214
class PylockUnsupportedVersionError(PylockValidationError):

tests/unit/test_pylock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_pylock_missing_version() -> None:
7676
}
7777
with pytest.raises(PylockRequiredKeyError) as exc_info:
7878
Pylock.from_dict(data)
79-
assert exc_info.value.key == "lock-version"
79+
assert str(exc_info.value) == "Missing required key 'lock-version'"
8080

8181

8282
def test_pylock_missing_created_by() -> None:
@@ -86,7 +86,7 @@ def test_pylock_missing_created_by() -> None:
8686
}
8787
with pytest.raises(PylockRequiredKeyError) as exc_info:
8888
Pylock.from_dict(data)
89-
assert exc_info.value.key == "created-by"
89+
assert str(exc_info.value) == "Missing required key 'created-by'"
9090

9191

9292
def test_pylock_missing_packages() -> None:
@@ -96,7 +96,7 @@ def test_pylock_missing_packages() -> None:
9696
}
9797
with pytest.raises(PylockRequiredKeyError) as exc_info:
9898
Pylock.from_dict(data)
99-
assert exc_info.value.key == "packages"
99+
assert str(exc_info.value) == "Missing required key 'packages'"
100100

101101

102102
def test_pylock_packages_without_dist() -> None:

0 commit comments

Comments
 (0)