@@ -87,11 +87,11 @@ class Config(BaseModel):
8787 if PYDANTIC_V2 :
8888 model_config = ConfigDict (arbitrary_types_allowed = True ) # pyright: ignore[reportAssignmentType]
8989
90- def get (self , item : str ) -> Any :
90+ def get (self , item : str ) -> Any : # pragma: no cover
9191 """Get attribute value by name."""
9292 return getattr (self , item )
9393
94- def __getitem__ (self , item : str ) -> Any :
94+ def __getitem__ (self , item : str ) -> Any : # pragma: no cover
9595 """Get item by key."""
9696 return self .get (item )
9797
@@ -128,7 +128,7 @@ def validate_file(cls, value: Any) -> TextIOBase | None: # noqa: N805
128128 if path .is_file ():
129129 return cast ("TextIOBase" , path .expanduser ().resolve ().open ("rt" ))
130130
131- msg = f"A file was expected but { value } is not a file."
131+ msg = f"A file was expected but { value } is not a file." # pragma: no cover
132132 raise Error (msg ) # pragma: no cover
133133
134134 @field_validator (
@@ -151,7 +151,7 @@ def validate_url(cls, value: Any) -> ParseResult | None: # noqa: N805
151151 return urlparse (value )
152152 if value is None : # pragma: no cover
153153 return None
154- msg = f"This protocol doesn't support only http/https. --input={ value } "
154+ msg = f"This protocol doesn't support only http/https. --input={ value } " # pragma: no cover
155155 raise Error (msg ) # pragma: no cover
156156
157157 # Pydantic 1.5.1 doesn't support each_item=True correctly
@@ -433,7 +433,9 @@ def _get_pyproject_toml_config(source: Path) -> dict[str, Any]:
433433 # Convert options from kebap- to snake-case
434434 pyproject_config = {k .replace ("-" , "_" ): v for k , v in pyproject_config .items ()}
435435 # Replace US-american spelling if present (ignore if british spelling is present)
436- if "capitalize_enum_members" in pyproject_config and "capitalise_enum_members" not in pyproject_config :
436+ if (
437+ "capitalize_enum_members" in pyproject_config and "capitalise_enum_members" not in pyproject_config
438+ ): # pragma: no cover
437439 pyproject_config ["capitalise_enum_members" ] = pyproject_config .pop ("capitalize_enum_members" )
438440 return pyproject_config
439441
0 commit comments