Skip to content

Commit 68add06

Browse files
committed
add few more pragma no covers
1 parent ada5f42 commit 68add06

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

typer/_click/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def format_message(self) -> str:
3333
return self.message
3434

3535
def __str__(self) -> str:
36-
return self.message
36+
return self.message # pragma: no cover
3737

3838
def show(self, file: IO[Any] | None = None) -> None:
3939
if file is None:

typer/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def get_error_hint(self) -> str:
164164
return f"'{self.display_name_raw}'"
165165

166166
def display_name_type(self, ctx: _click.Context) -> str | None:
167-
return self.metavar
167+
# Is overridden in practice by TyperOption and TyperArgument
168+
return self.metavar # pragma: no cover
168169

169170
def display_type(self, ctx: _click.Context) -> str:
170171
"""Formatted type string for help, e.g. ``<int>``"""

typer/display.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def get_error_msg(exc: ValidationError) -> str:
1919
errors = exc.errors()
2020
if errors:
2121
return errors[0]["msg"]
22-
return str(exc)
22+
return str(exc) # pragma: no cover

0 commit comments

Comments
 (0)