Skip to content

Commit

Permalink
pragma no cover
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Jun 9, 2022
1 parent 8f81cca commit 2aa2319
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion PyPDF2/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def get_page(
"get_page(pageNumber)", "get_page(page_number)", "4.0.0"
)
page_number = pageNumber
if page_number is None and pageNumber is None:
if page_number is None and pageNumber is None: # pragma: no cover
raise ValueError("Please specify the page_number")
pages = cast(Dict[str, Any], self.get_object(self._pages))
# XXX: crude hack
Expand Down
6 changes: 3 additions & 3 deletions PyPDF2/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def readFromStream(

def readHexStringFromStream(
stream: StreamType,
) -> Union["TextStringObject", "ByteStringObject"]:
) -> Union["TextStringObject", "ByteStringObject"]: # pragma: no cover
deprecate_with_replacement(
"readHexStringFromStream", "read_hex_string_from_stream", "4.0.0"
)
Expand Down Expand Up @@ -392,7 +392,7 @@ def read_hex_string_from_stream(
def readStringFromStream(
stream: StreamType,
forced_encoding: Union[None, str, List[str], Dict[int, str]] = None,
) -> Union["TextStringObject", "ByteStringObject"]:
) -> Union["TextStringObject", "ByteStringObject"]: # pragma: no cover
deprecate_with_replacement("readStringFromStream", "read_string_from_stream")
return read_string_from_stream(stream, forced_encoding)

Expand Down Expand Up @@ -957,7 +957,7 @@ def remove_child(self, child: Any) -> None:
if NameObject("/Prev") in child_obj:
del child_obj[NameObject("/Prev")]

def emptyTree(self) -> None:
def emptyTree(self) -> None: # pragma: no cover
deprecate_with_replacement("emptyTree", "empty_tree", "4.0.0")
self.empty_tree()

Expand Down
26 changes: 13 additions & 13 deletions PyPDF2/xmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __init__(self, stream: ContentStream) -> None:
self.cache: Dict[Any, Any] = {}

@property
def rdfRoot(self) -> XmlElement:
def rdfRoot(self) -> XmlElement: # pragma: no cover
deprecate_with_replacement("rdfRoot", "rdf_root", "4.0.0")
return self.rdf_root

Expand Down Expand Up @@ -384,12 +384,12 @@ def _get_text(self, element: XmlElement) -> str:
"""

@property
def xmp_createDate(self) -> datetime.datetime:
def xmp_createDate(self) -> datetime.datetime: # pragma: no cover
deprecate_with_replacement("xmp_createDate", "xmp_create_date")
return self.xmp_create_date

@xmp_createDate.setter
def xmp_createDate(self, value: datetime.datetime) -> None:
def xmp_createDate(self, value: datetime.datetime) -> None: # pragma: no cover
deprecate_with_replacement("xmp_createDate", "xmp_create_date")
self.xmp_create_date = value

Expand All @@ -402,12 +402,12 @@ def xmp_createDate(self, value: datetime.datetime) -> None:
"""

@property
def xmp_modifyDate(self) -> datetime.datetime:
def xmp_modifyDate(self) -> datetime.datetime: # pragma: no cover
deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date")
return self.xmp_modify_date

@xmp_modifyDate.setter
def xmp_modifyDate(self, value: datetime.datetime) -> None:
def xmp_modifyDate(self, value: datetime.datetime) -> None: # pragma: no cover
deprecate_with_replacement("xmp_modifyDate", "xmp_modify_date")
self.xmp_modify_date = value

Expand All @@ -421,12 +421,12 @@ def xmp_modifyDate(self, value: datetime.datetime) -> None:
"""

@property
def xmp_metadataDate(self) -> datetime.datetime:
def xmp_metadataDate(self) -> datetime.datetime: # pragma: no cover
deprecate_with_replacement("xmp_metadataDate", "xmp_metadata_date")
return self.xmp_metadata_date

@xmp_metadataDate.setter
def xmp_metadataDate(self, value: datetime.datetime) -> None:
def xmp_metadataDate(self, value: datetime.datetime) -> None: # pragma: no cover
deprecate_with_replacement("xmp_metadataDate", "xmp_metadata_date")
self.xmp_metadata_date = value

Expand All @@ -436,12 +436,12 @@ def xmp_metadataDate(self, value: datetime.datetime) -> None:
"""

@property
def xmp_creatorTool(self) -> str:
def xmp_creatorTool(self) -> str: # pragma: no cover
deprecate_with_replacement("xmp_creatorTool", "xmp_creator_tool")
return self.xmp_creator_tool

@xmp_creatorTool.setter
def xmp_creatorTool(self, value: str) -> None:
def xmp_creatorTool(self, value: str) -> None: # pragma: no cover
deprecate_with_replacement("xmp_creatorTool", "xmp_creator_tool")
self.xmp_creator_tool = value

Expand All @@ -451,12 +451,12 @@ def xmp_creatorTool(self, value: str) -> None:
"""

@property
def xmpmm_documentId(self) -> str:
def xmpmm_documentId(self) -> str: # pragma: no cover
deprecate_with_replacement("xmpmm_documentId", "xmpmm_document_id")
return self.xmpmm_document_id

@xmpmm_documentId.setter
def xmpmm_documentId(self, value: str) -> None:
def xmpmm_documentId(self, value: str) -> None: # pragma: no cover
deprecate_with_replacement("xmpmm_documentId", "xmpmm_document_id")
self.xmpmm_document_id = value

Expand All @@ -467,12 +467,12 @@ def xmpmm_documentId(self, value: str) -> None:
"""

@property
def xmpmm_instanceId(self) -> str:
def xmpmm_instanceId(self) -> str: # pragma: no cover
deprecate_with_replacement("xmpmm_instanceId", "xmpmm_instance_id")
return self.xmpmm_instance_id

@xmpmm_instanceId.setter
def xmpmm_instanceId(self, value: str) -> None:
def xmpmm_instanceId(self, value: str) -> None: # pragma: no cover
deprecate_with_replacement("xmpmm_instanceId", "xmpmm_instance_id")
self.xmpmm_instance_id = value

Expand Down

0 comments on commit 2aa2319

Please sign in to comment.