Skip to content

test: use controller.OutputCode in the R intent tests - #251

Merged
schloerke merged 1 commit into
mainfrom
schloerke/resolve-recent-issue
Sep 13, 2026
Merged

schloerke merged 1 commit into
mainfrom
schloerke/resolve-recent-issue

Conversation

@schloerke

Copy link
Copy Markdown
Collaborator

Closes #250.

controller.OutputTextVerbatim is deprecated in py-shiny 1.8.0 and warns on every construction. This swaps the five uses in tests/test_examples_intent_r.py to controller.OutputCode.

The open question in the issue, answered

#250 asked whether OutputCode locates and reads R's verbatimTextOutput() markup correctly, since it is a py-side control driving R-rendered DOM. It does — the two controllers are identical apart from the deprecation warning. At the pinned py-shiny submodule commit (7ba439c), in shiny/playwright/controller/_output.py:

  • OutputCode.__init__ → loc=f"pre#{id}.shiny-text-output" (line 194)
  • OutputTextVerbatim.__init__ → loc=f"pre#{id}.shiny-text-output" (line 251)

Both subclass _OutputTextValue and define the same expect_has_placeholder. Same selector, same base, same methods. Whatever the old controller matched in R's verbatimTextOutput() output, the new one matches identically, so there is no py-control-vs-R-DOM risk and nothing to raise upstream.

Testing

Not run locally: make test-examples-intent needs make all first, and _shinylive/ in this worktree is unbuilt. Leaving verification to CI. The change is a pure identifier swap with no behavioural delta.

`controller.OutputTextVerbatim` is deprecated in py-shiny 1.8.0 and warns on
every construction. `OutputCode` is the replacement and is identical in
behaviour -- same `pre#{id}.shiny-text-output` locator, same
`_OutputTextValue` base -- so the swap is mechanical and does not depend on
R's `verbatimTextOutput()` markup differing from the py side.

Closes #250
@github-actions

Copy link
Copy Markdown
Contributor

Unit tests only — the pure-logic modules in src/. The React components, hooks, engine proxies and service worker are covered by the pytest + Playwright suites in tests/, which are not measured here.

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 100% 1994/1994
🟢 Branches 100% 400/400
🟢 Functions 100% 96/96
🟢 Lines 100% 1994/1994

Test suite run success

342 tests passing in 20 suites.

Report generated by 🧪jest coverage report action from b44d08d

@schloerke
schloerke merged commit 80eb17c into main Sep 13, 2026
11 checks passed
@schloerke
schloerke deleted the schloerke/resolve-recent-issue branch September 13, 2026 04:07
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.

R example intent tests use the deprecated controller.OutputTextVerbatim

1 participant