Skip to content

Commit 178599a

Browse files
committed
Don't run doctests on 1.12
1 parent 148e68b commit 178599a

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

test/ad.jl

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ using DynamicPPL: LogDensityFunction
33
@testset "Automatic differentiation" begin
44
# Used as the ground truth that others are compared against.
55
ref_adtype = AutoForwardDiff()
6-
test_adtypes = [AutoReverseDiff(; compile=false), AutoReverseDiff(; compile=true)]
76

8-
if USE_MOONCAKE
9-
push!(test_adtypes, AutoMooncake(; config=nothing))
7+
test_adtypes = if IS_PRERELEASE
8+
[AutoReverseDiff(; compile=false), AutoReverseDiff(; compile=true)]
9+
else
10+
[
11+
AutoReverseDiff(; compile=false),
12+
AutoReverseDiff(; compile=true),
13+
AutoMooncake(; config=nothing),
14+
]
1015
end
1116

1217
@testset "Unsupported backends" begin

test/runtests.jl

+19-16
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ include("test_util.jl")
4141

4242
# Don't attempt to import Mooncake on 1.12
4343
# https://github.com/chalk-lab/Mooncake.jl/pull/545
44-
USE_MOONCAKE = VERSION >= v"1.12"
44+
IS_PRERELEASE = VERSION >= v"1.12"
4545

46-
if USE_MOONCAKE
46+
if IS_PRERELEASE
4747
Pkg.add("Mooncake")
4848
using Mooncake: Mooncake
4949
end
@@ -88,7 +88,7 @@ end
8888
end
8989
@testset "ad" begin
9090
include("ext/DynamicPPLForwardDiffExt.jl")
91-
if USE_MOONCAKE
91+
if !IS_PRERELEASE
9292
include("ext/DynamicPPLMooncakeExt.jl")
9393
end
9494
include("ad.jl")
@@ -97,19 +97,22 @@ end
9797
@test_throws ErrorException prob"..."
9898
@test_throws ErrorException logprob"..."
9999
end
100-
@testset "doctests" begin
101-
DocMeta.setdocmeta!(
102-
DynamicPPL,
103-
:DocTestSetup,
104-
:(using DynamicPPL, Distributions);
105-
recursive=true,
106-
)
107-
doctestfilters = [
108-
# Ignore the source of a warning in the doctest output, since this is dependent on host.
109-
# This is a line that starts with "└ @ " and ends with the line number.
110-
r"└ @ .+:[0-9]+",
111-
]
112-
doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters)
100+
if !IS_PRERELEASE
101+
# Don't run doctests on prerelease as error messages etc. may vary
102+
@testset "doctests" begin
103+
DocMeta.setdocmeta!(
104+
DynamicPPL,
105+
:DocTestSetup,
106+
:(using DynamicPPL, Distributions);
107+
recursive=true,
108+
)
109+
doctestfilters = [
110+
# Ignore the source of a warning in the doctest output, since this is dependent on host.
111+
# This is a line that starts with "└ @ " and ends with the line number.
112+
r"└ @ .+:[0-9]+",
113+
]
114+
doctest(DynamicPPL; manual=false, doctestfilters=doctestfilters)
115+
end
113116
end
114117
end
115118
end

0 commit comments

Comments
 (0)