Skip to content

Commit

Permalink
Merge pull request #284 from FluxML/fixb
Browse files Browse the repository at this point in the history
Fix failing test caused by new Julia release
  • Loading branch information
ablaom authored Nov 13, 2024
2 parents 6211c8e + d42dbcc commit 9da1d2d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/mlj_model_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ mutable struct LisasBuilder
n1::Int
end

# UndefVarError accepts two inputs from julia > v"1.9"
_UndefVarError(var, scope) = @static if VERSION < v"1.10"
UndefVarError(var)
else
UndefVarError(var, scope)
end

@testset "builder errors and issue #237" begin
# create a builder with an intentional flaw;
# `Chains` is undefined - it should be `Chain`
Expand All @@ -153,7 +160,7 @@ end
y = rand(Float32, 75)
@test_logs(
(:error, MLJFlux.ERR_BUILDER),
@test_throws UndefVarError(:Chains) MLJBase.fit(model, 0, X, y)
@test_throws _UndefVarError(:Chains, Flux) MLJBase.fit(model, 0, X, y)
)
end

Expand Down

0 comments on commit 9da1d2d

Please sign in to comment.