Skip to content

Commit

Permalink
improve ExtrasNotInstalledError message
Browse files Browse the repository at this point in the history
to avoid confusions between the 'extras' name and the missing module import
  • Loading branch information
anthrotype committed Nov 7, 2022
1 parent b4e5689 commit 67310fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ufoLib2/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ExtrasNotInstalledError(Error):
"""The extras required for this feature are not installed."""

def __init__(self, extras: str) -> None:
super().__init__(f"Extras not installed: {extras!r}")
super().__init__(f"Extras not installed: ufoLib2[{extras}]")

def __call__(self, *args: Any, **kwargs: Any) -> None:
raise self
2 changes: 1 addition & 1 deletion tests/serde/test_serde.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Foo:
foo = Foo(1)

with pytest.raises(
ExtrasNotInstalledError, match=f"Extras not installed: '{extras}'"
ExtrasNotInstalledError, match=f"Extras not installed: ufoLib2\[{extras}\]"
) as exc_info:
dumps_method = getattr(foo, f"{extras}_dumps")
dumps_method()
Expand Down

0 comments on commit 67310fe

Please sign in to comment.