Skip to content

Bad interaction with Documenter's doctests due to module scoping #68

@giordano

Description

@giordano

This was reported to me a few days ago, but I didn't understand it at first: JuliaAstro/Spectra.jl#38 (comment). But today I ran into the same issue myself: NumericalEarth/Breeze.jl#95 (comment). As far as I understand, due to the module inside which tests are evaluated inside ParallelTestRunner, Documenter's doctests may fail if the output somehow depends on the scope of the Main module?(???) A workaround is to do something like

@eval Main using MyPackage
using Documenter: DocMeta, doctest
DocMeta.setdocmeta!(Main.MyPackage, :DocTestSetup, :(using MyPackage); recursive = true)

doctest(Main.MyPackage)

but I wonder if ParallelTestRunner can do something to make this unnecessary, or at least should document this module behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions