Skip to content

Commit

Permalink
chore: ignore coverage of abstract methods (#699)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck authored Oct 10, 2024
1 parent 2b952e9 commit ced6d69
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cyclonedx/model/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ class Dependable(ABC):
@property
@abstractmethod
def bom_ref(self) -> BomRef:
...
... # pragma: no cover
14 changes: 7 additions & 7 deletions cyclonedx/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def __init__(self, bom: 'Bom', **kwargs: int) -> None:
@property
@abstractmethod
def schema_version(self) -> SchemaVersion:
...
... # pragma: no cover

@property
@abstractmethod
def output_format(self) -> OutputFormat:
...
... # pragma: no cover

@property
def generated(self) -> bool:
Expand All @@ -69,13 +69,13 @@ def set_bom(self, bom: 'Bom') -> None:

@abstractmethod
def generate(self, force_regeneration: bool = False) -> None:
...
... # pragma: no cover

@abstractmethod
def output_as_string(self, *,
indent: Optional[Union[int, str]] = None,
**kwargs: Any) -> str:
...
... # pragma: no cover

def output_to_file(self, filename: str, allow_overwrite: bool = False, *,
indent: Optional[Union[int, str]] = None,
Expand All @@ -94,19 +94,19 @@ def output_to_file(self, filename: str, allow_overwrite: bool = False, *,
@overload
def make_outputter(bom: 'Bom', output_format: Literal[OutputFormat.JSON],
schema_version: SchemaVersion) -> 'JsonOutputter':
...
... # pragma: no cover


@overload
def make_outputter(bom: 'Bom', output_format: Literal[OutputFormat.XML],
schema_version: SchemaVersion) -> 'XmlOutputter':
...
... # pragma: no cover


@overload
def make_outputter(bom: 'Bom', output_format: OutputFormat,
schema_version: SchemaVersion) -> Union['XmlOutputter', 'JsonOutputter']:
...
... # pragma: no cover


def make_outputter(bom: 'Bom', output_format: OutputFormat, schema_version: SchemaVersion) -> BaseOutput:
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/output/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def output_as_string(self, *,

@abstractmethod
def _get_schema_uri(self) -> Optional[str]:
pass
... # pragma: no cover


class JsonV1Dot0(Json, SchemaVersion1Dot0):
Expand Down
2 changes: 1 addition & 1 deletion cyclonedx/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BaseSchemaVersion(ABC, ViewType):
@property
@abstractmethod
def schema_version_enum(self) -> SchemaVersion:
...
... # pragma: no cover

def get_schema_version(self) -> str:
return self.schema_version_enum.to_version()
Expand Down
12 changes: 6 additions & 6 deletions cyclonedx/validation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def validate_str(self, data: str) -> Optional[ValidationError]:
:retval None: if ``data`` is valid
:retval ValidationError: if ``data`` is invalid
"""
...
... # pragma: no cover


class BaseSchemabasedValidator(ABC, SchemabasedValidator):
Expand All @@ -76,31 +76,31 @@ def schema_version(self) -> 'SchemaVersion':
@abstractmethod
def output_format(self) -> OutputFormat:
"""Get the format."""
...
... # pragma: no cover

@property
@abstractmethod
def _schema_file(self) -> Optional[str]:
"""Get the schema file according to schema version."""
...
... # pragma: no cover


@overload
def make_schemabased_validator(output_format: Literal[OutputFormat.JSON], schema_version: 'SchemaVersion'
) -> 'JsonValidator':
...
... # pragma: no cover


@overload
def make_schemabased_validator(output_format: Literal[OutputFormat.XML], schema_version: 'SchemaVersion'
) -> 'XmlValidator':
...
... # pragma: no cover


@overload
def make_schemabased_validator(output_format: OutputFormat, schema_version: 'SchemaVersion'
) -> Union['JsonValidator', 'XmlValidator']:
...
... # pragma: no cover


def make_schemabased_validator(output_format: OutputFormat, schema_version: 'SchemaVersion'
Expand Down

0 comments on commit ced6d69

Please sign in to comment.