From 9dc9ecb30f21ed88c1baf3078c56fcdc4349798c Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 21 Jan 2024 14:13:50 +0100 Subject: [PATCH 1/2] fix tests on nightly --- .github/workflows/Test.yml | 2 +- test/helpers.jl | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index ba4243ef08..359a6a6149 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: # We test quite a lot of versions because we do some OS and version specific things unfortunately - julia-version: ["1.6", "1.8", "1.10"] #, "nightly"] # "~1.11.0-0"] + julia-version: ["1.6", "1.8", "1.10", "nightly"] # "~1.11.0-0"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: diff --git a/test/helpers.jl b/test/helpers.jl index ff7406b42d..67dfb96812 100644 --- a/test/helpers.jl +++ b/test/helpers.jl @@ -48,9 +48,14 @@ end function expecterror(err, cell; strict=true) cell.errored || return false - io = IOBuffer() - showerror(io, err) - msg = String(take!(io)) + msg = sprint(showerror, err) + + # UndefVarError(:x, #undef) + if err isa UndefVarError && !isdefined(e, :scope) && VERSION > v"1.10" + strict = false + msg = first(split(msg, '\n'; limit=2)) + end + if strict return cell.output.body[:msg] == msg else From c559db9ed0fc428fca0c3a4d8427c913c5195b35 Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Sun, 21 Jan 2024 15:09:26 +0100 Subject: [PATCH 2/2] Update helpers.jl --- test/helpers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers.jl b/test/helpers.jl index 67dfb96812..a436f87fc7 100644 --- a/test/helpers.jl +++ b/test/helpers.jl @@ -51,7 +51,7 @@ function expecterror(err, cell; strict=true) msg = sprint(showerror, err) # UndefVarError(:x, #undef) - if err isa UndefVarError && !isdefined(e, :scope) && VERSION > v"1.10" + if err isa UndefVarError && !isdefined(err, :scope) && VERSION > v"1.10" strict = false msg = first(split(msg, '\n'; limit=2)) end