JuliaDocs/Documenter.jl

Doctests not catching exceptions from show

Open

#1,631 opened on Jul 6, 2021

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Julia (513 forks)batch import
Topic: UsabilityType: Bughelp wanted

Repository metrics

Stars
 (910 stars)
PR merge metrics
 (Avg merge 16d 9h) (3 merged PRs in 30d)

Description

This type of doctest, where show throws an error, does not work currently:

julia> gd
Error showing value of type GroupedDataFrame{DataFrame}:
ERROR: AssertionError: The current number of rows in the parent data frame is 3 and it does not match the number of rows it contained when GroupedDataFrame was created which was 2. The number of rows in the parent data frame has likely been changed unintentionally (e.g. using subset!, filter!, delete!, push!, or append! functions).

I believe it's because Documenter does not handle exceptions from the show calls which happen here: https://github.com/JuliaDocs/Documenter.jl/blob/6c8679bac445ab1c656744075b13a57835081cc3/src/DocTests.jl#L319

X-ref https://github.com/JuliaData/DataFrames.jl/pull/2811

Contributor guide