Skip to content

Commit bdd7293

Browse files
committed
fix test in PR526
1 parent beb10a4 commit bdd7293

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/models/aliases/aliases_gamma_tests.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@
3939
end
4040

4141
@testitem "`Gamma` by itself cannot be used as a node" begin
42+
using Logging
43+
4244
@model function gamma_by_itself(d)
43-
x ~ Gamma(1.0, 1.0)
44-
d ~ Gamma(x, 1.0)
45+
d ~ Gamma(1.0, 1.0)
4546
end
46-
@test_throws "`Gamma` cannot be constructed without keyword arguments. Use `Gamma(shape = ..., rate = ...)` or `Gamma(shape = ..., scale = ...)`." infer(
47-
model = gamma_by_itself(), data = (d = 1.0,), iterations = 1, free_energy = false
48-
)
49-
end
47+
48+
io = IOBuffer()
49+
50+
Logging.with_logger(Logging.SimpleLogger(io)) do
51+
infer(model = gamma_by_itself(), data = (d = 1.0,))
52+
end
53+
54+
@test occursin("'Gamma' and 'GammaShapeScale' without keywords are constructed with parameters (Shape, Scale)", String(take!(io)))
55+
end

0 commit comments

Comments
 (0)