Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
OkonSamuel authored Nov 13, 2024
1 parent 4d9fb34 commit de94844
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.9"
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 de94844

Please sign in to comment.