From de948445e1a4d9ce008b874cad6677604e169d05 Mon Sep 17 00:00:00 2001 From: Okon Samuel <39421418+OkonSamuel@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:47:44 +0100 Subject: [PATCH] fix failing test --- test/mlj_model_interface.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/mlj_model_interface.jl b/test/mlj_model_interface.jl index 7984990..49febe1 100644 --- a/test/mlj_model_interface.jl +++ b/test/mlj_model_interface.jl @@ -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` @@ -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