Printing types: regular usage vs. jldoctests

When I use my package regularly, a data type is shown like this:

julia> using PDBTools

julia> ats = read_pdb(PDBTools.TESTPDB)
   Vector{Atom{Nothing}} with 62026 atoms with fields:
   index name resname chain   resnum  residue        x        y        z occup  beta model segname index_pdb
       1    N     ALA     A        1        1   -9.229  -14.861   -5.481  0.00  0.00     1    PROT         1

where we see Vector{Atom{Nothing}} as the type of the array.

Now, I have jldoctest which is identical to the above, but the test fails because it expects Vector{PDBTools.Atom{Nothing}} instead:

│   diff =
│       Vector{Atom{Nothing}} Vector{PDBTools.Atom{Nothing}} with 72 atoms with fields:
│       index name resname chain   resnum  residue        x        y        z occup  beta model segname index_pdb
│           1    N     ALA     A        1        1   -9.229  -14.861   -5.481  0.00  0.00     1    PROT         1

Why is the type printed differently in the jlsdoctest vs. regular usage of the package, and how that can be solved?

Thanks.

Additional info: This incongruity happens on the CI run, but not when I run doctests locally. I can even run doctests(PDBTools; fix=true) and all works locally, but these tests fail on the CI execution.

edit: The issue is when running this as part of the test suite of the package:

@testitem "Doctests" begin
    using Documenter: doctest
    using PDBTools # with or without this
    doctest(PDBTools)
end

Thus, I’ll just remove that from the test suite. But I wonder which is the scoping issue that’s causing the types to be printed differently in each case.