Skip to content

TST: Cover content stream renaming, scaling and merging of PageObject - #4338

Merged
stefan6419846 merged 2 commits into
mainfrom
tst/coverage-page
Nov 2, 2026
Merged

stefan6419846 merged 2 commits into
mainfrom
tst/coverage-page

Conversation

@MartinThoma

Copy link
Copy Markdown
Member

Add tests for PageObject branches without coverage so far:

  • _content_stream_rename() with an inline image: renaming a color space resource called /G renames "/G cs", but keeps /CS /G in the inline image, where it means DeviceGray,
  • scale() of a page with a /VP viewport, given as array and as dictionary,
  • extract_text() passing text to visitor_text that is not terminated by an ET operator.

Two strict xfail tests document bugs in merge_page():

Where the expected behavior comes from ISO 32000-2:2020, the docstring names the section.

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.79%. Comparing base (0447b44) to head (0dd5cd9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4338      +/-   ##
==========================================
+ Coverage   98.67%   98.79%   +0.12%     
==========================================
  Files          59       59              
  Lines       12114    12114              
  Branches     2304     2304              
==========================================
+ Hits        11953    11968      +15     
+ Misses         84       70      -14     
+ Partials       77       76       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MartinThoma
MartinThoma marked this pull request as ready for review November 2, 2026 12:21
Comment thread tests/test_page.py Resolved
Add tests for PageObject branches without coverage so far:

* _content_stream_rename() with an inline image: renaming a color space
  resource called /G renames "/G cs", but keeps /CS /G in the inline
  image, where it means DeviceGray,
* scale() of a page with a /VP viewport, given as array and as
  dictionary,
* extract_text() passing text to visitor_text that is not terminated by
  an ET operator.

Two strict xfail tests document bugs in merge_page():

* #4335: merging into a page whose /Annots is null silently drops the
  annotations of the merged page,
* #3467: merging a page whose annotations were added with
  PdfWriter.add_annotation() raises TypeError: clone() creates the copy
  with self.__class__(), but Highlight, FreeText, ... have required
  keyword-only arguments. The open PRs #3785 and #4262 fix it.

Where the expected behavior comes from ISO 32000-2:2020, the docstring
names the section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stefan6419846
stefan6419846 merged commit dbe8728 into main Nov 2, 2026
20 checks passed
@stefan6419846
stefan6419846 deleted the tst/coverage-page branch November 2, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants