Skip to content

Fix stale check_model doctest broken by the #1438 fence fix#1439

Merged
shravanngoswamii merged 1 commit into
mainfrom
sg/fix-check-model-doctest
Jul 17, 2026
Merged

Fix stale check_model doctest broken by the #1438 fence fix#1439
shravanngoswamii merged 1 commit into
mainfrom
sg/fix-check-model-doctest

Conversation

@shravanngoswamii

Copy link
Copy Markdown
Member

main's Doctests workflow is currently red: https://github.com/TuringLang/DynamicPPL.jl/actions/runs/29509495151/job/87658917625

#1438 fixed a real markdown bug (an unclosed ``` fence in check_model's docstring), which is good, but closing that fence changed where Documenter thinks the jldoctest block ends. That exposed a doctest that was already stale: the "Incorrect model" example expected

julia> check_model(model; error_on_failure=true)
ERROR: varname x used multiple times in model

but check_model's actual behavior for repeated VarNames (since at least the DebugAccumulator rework) is to @warn per repeated variable and then raise the generic error_on_failure message at src/debug_utils.jl:265-266:

julia> check_model(model; error_on_failure=true)
┌ Warning: Assigning to the variable x led to a previous value being overwritten. This indicates that a value is being set twice (e.g. if the same variable occurs in a model twice).
└ @ DynamicPPL.DebugUtils DynamicPPL.jl/src/debug_utils.jl:237
ERROR: Model check failed; please see the warnings above for details.

Updated the docstring to match, mirroring the same warning-block style already used in the "Correct model" example just above it. Verified locally: GROUP=Doctests julia --project=. -e 'using Pkg; Pkg.test()' passes (1/1) on Julia 1.12, matching the CI job that was failing.

…a generic error, not the old specific message
@github-actions

Copy link
Copy Markdown
Contributor

DynamicPPL.jl documentation for PR #1439 is available at:
https://TuringLang.github.io/DynamicPPL.jl/previews/PR1439/

@shravanngoswamii
shravanngoswamii merged commit 29778df into main Jul 17, 2026
4 of 23 checks passed
@shravanngoswamii
shravanngoswamii deleted the sg/fix-check-model-doctest branch July 17, 2026 05:37
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.

1 participant