Skip to content

Share the page machinery of the unit test reports with other reports - #25

Merged
Paebbels merged 4 commits into
devfrom
claude/report-pages-base
Oct 9, 2026
Merged

Paebbels merged 4 commits into
devfrom
claude/report-pages-base

Conversation

@pytooling-claude

@pytooling-claude pytooling-claude Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The machinery generating pages from a unit test report becomes shared, so the code coverage report gets its pages the same way (#26, stacked on this one).

Changes

  • pyTooling.Sphinx.Pages (new): ReportPages, the base-class of a report's pages. Moved there from UnittestReportPages: the document names (UNSAFE_CHARACTERS, collision suffixes), registering and generating the pages, the hidden tables of contents and the navigation without the pages' own sections, GetPages(), GenerateAll(), HideSource(), Entry(), DocNames, the helpers for fields and tables, and CreateReference() (was UnittestSummary.CreateReference()). A derived class names an object (_Name(), _Title()), lists its children (_Children()) and builds its page (_Page()).
    • ReportPages.CheckPagesConfiguration() checks and normalizes a report's key pages, which UnittestSummary checked itself.
  • pyTooling.Sphinx.UnittestPages.UnittestReportPages derives from ReportPages; the pages are unchanged.
  • pyTooling.Sphinx: the domain report serves any role referring to the objects of reports with pages.
    • UnittestEntry → ReportEntry, which carries the separator of its qualified name (. for testcases).
    • UnittestRole → ReportRole.
    • UNITTEST_ROLES → REPORT_ROLES: per role a ReportRoleDefinition - object type, configuration value declaring its reports, and how a warning names them.
    • ReportDomain.AddUnittestEntry()/FindUnittestEntries() → AddEntry()/FindEntries(); the domain data is keyed by role (tc, ts), and data_version is raised, so a pickled environment of the old layout is dropped.

Unit Tests

  • The tests use the new names; all 190 pass unchanged otherwise.

Changes after opening


Related Issues and Pull-Requests

@codacy-production

codacy-production Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 18 minor

Alerts:
⚠ 18 issues (≤ 0 issues of at least minor severity)

Results:
18 new issues

Category Results
Documentation 4 minor
CodeStyle 14 minor

View in Codacy

🟢 Metrics 12 complexity · 0 duplication

Metric Results
Complexity 12
Duplication 0

View in Codacy

🟢 Coverage 96.49% diff coverage · +0.36% coverage variation

Metric Results
Coverage variation ✅ +0.36% coverage variation (-1.00%)
Diff coverage ✅ 96.49% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (17841b8) 3070 2460 80.13%
Head commit (13a3e92) 3121 (+51) 2512 (+52) 80.49% (+0.36%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#25) 228 220 96.49%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.29825% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.85%. Comparing base (17841b8) to head (13a3e92).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
pyTooling/Sphinx/Pages.py 94.44% 6 Missing and 3 partials ⚠️
pyTooling/Sphinx/__init__.py 90.00% 2 Missing and 1 partial ⚠️
pyTooling/Sphinx/Unittest.py 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #25      +/-   ##
==========================================
+ Coverage   77.49%   77.85%   +0.36%     
==========================================
  Files          19       20       +1     
  Lines        3070     3121      +51     
  Branches      448      449       +1     
==========================================
+ Hits         2379     2430      +51     
+ Misses        610      609       -1     
- Partials       81       82       +1     
Flag Coverage Δ
unittests 77.85% <94.29%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

claude-code and others added 2 commits October 9, 2026 17:17
The generation of pages from a report - document names, registration, generation, navigation, references - moves
from 'UnittestReportPages' into the base-class 'ReportPages' of the new module 'pyTooling.Sphinx.Pages'. A derived
class names an object, lists its children and builds its page.

The domain 'report' serves any role referring to the objects of reports with pages: 'UnittestEntry' becomes
'ReportEntry', which carries the separator of its qualified name, 'UnittestRole' becomes 'ReportRole', and the table
'REPORT_ROLES' names per role the object type and the configuration value declaring its reports. The domain data is
keyed by role; its version is raised, so a pickled environment of the old layout is dropped.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
'ReportPages.CheckPagesConfiguration' validates and normalizes the document name a report's pages are generated
below, so every kind of report with pages checks it the same way.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude
pytooling-claude Bot force-pushed the claude/report-pages-base branch from 3c4c465 to 628335c Compare October 9, 2026 17:29
Comment thread pyTooling/Sphinx/Pages.py Resolved
Comment thread pyTooling/Sphinx/Pages.py Resolved
claude-code and others added 2 commits October 9, 2026 18:35
…es' is a tuple

'GetPages' returned None for a report without pages, for its callers to
detect. It raises KeyError now; 'HasPages' asks first. 'DocNames' is a
view of the generated documents, so it returns a tuple (review).

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
The example moves into a description paragraph below the summary
(review rule of edaa-org/pyEDAA.Reports#271).

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
pytooling-claude Bot pushed a commit that referenced this pull request Oct 9, 2026
'GetPages' raises KeyError for a report without pages (#25 review). The
summary table asks 'HasPages' instead of passing None-or-pages down to
'_NameCell'.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@Paebbels
Paebbels merged commit 94e92d2 into dev Oct 9, 2026
52 of 53 checks passed
@Paebbels
Paebbels deleted the claude/report-pages-base branch October 9, 2026 18:48
@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 9, 2026
This was referenced Oct 17, 2026
@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 28, 2026
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