Skip to content

Commit

Permalink
BUG: PendingDeprecationWarning for getContents (#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma authored May 23, 2022
1 parent 68c9202 commit 9947c7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PyPDF2/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def _merge_page(self, page2, page2transformation=None, ctm=None, expand=False):
PageObject._push_pop_gs(original_content, self.pdf)
)

page2content = page2.getContents()
page2content = page2.get_contents()
if page2content is not None:
page2content = ContentStream(page2content, self.pdf)
page2content.operations.insert(
Expand Down
6 changes: 4 additions & 2 deletions Tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
[(0, True), (-1, True), (1, True), ("1", False), (1.5, False)],
)
def test_isInt(value, expected):
assert PyPDF2._utils.isInt(value) == expected
with pytest.warns(UserWarning):
assert PyPDF2._utils.isInt(value) == expected


def test_isBytes():
assert PyPDF2._utils.isBytes(b"")
with pytest.warns(UserWarning):
assert PyPDF2._utils.isBytes(b"")


@pytest.mark.parametrize(
Expand Down

0 comments on commit 9947c7b

Please sign in to comment.