From a18c0943095801a32b888506fff4dafc379e7a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baru=C4=8Di=C4=87?= Date: Fri, 19 Apr 2024 09:52:36 +0200 Subject: [PATCH] Test: serialize models to temporary directory --- test/runtests.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index a85c81a..a09259e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -402,9 +402,12 @@ end kernel(x1, x2) = x1' * x2 model₁ = svmtrain(X, y, kernel=kernel) - serialize("serialized_svm.jls", model₁) - model₂ = deserialize("serialized_svm.jls") + model₂ = mktempdir() do path + modelpath = joinpath(path, "serialized_svm.jls") + serialize(modelpath, model₁) + return deserialize(modelpath) + end y₁ = svmpredict(model₁, X) y₂ = svmpredict(model₂, X)