Skip to content

Make doctest runnable inside @testitem #2791

@schlichtanders

Description

@schlichtanders

I am unable to make doctset runnable inside @testitem

@testitem "Doctests (Documenter.jl)" begin
    using MyPackage
    using Documenter
    DocMeta.setdocmeta!(MyPackage, :DocTestSetup, :(using MyPackage); recursive=true)
    doctest(MyPackage)
end

fails with

┌ Error: Failed to evaluate `CurrentModule = MyPackage` in `@meta` block.
│   exception =
│    UndefVarError: `MyPackage` not defined in `Main`
│    Suggestion: check for spelling errors or missing imports.
│    Hint: MyPackage is loaded but not imported in the active module Main.
└ @ Documenter ~/.julia/packages/Documenter/HdXI4/src/utilities/utilities.jl:47

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