diff --git a/test/activate_do.jl b/test/activate_do.jl index c824152..d991920 100644 --- a/test/activate_do.jl +++ b/test/activate_do.jl @@ -16,7 +16,7 @@ TestEnv.activate("ChainRulesCore") do @eval using FiniteDifferences end - @test isdefined(@__MODULE__, :FiniteDifferences) + @test Base.invokelatest(isdefined, @__MODULE__, :FiniteDifferences) # We use endswith here because on MacOS GitHub runners for some reasons the paths are slightly different # We also skip on Julia 1.2 and 1.3 on Windows because it is using 8 character shortened paths in one case @@ -44,7 +44,7 @@ TestEnv.activate("MCMCDiagnosticTools"; kw...) do @eval using FFTW end - @test isdefined(@__MODULE__, :FFTW) + @test Base.invokelatest(isdefined, @__MODULE__, :FFTW) @test endswith(Base.active_project(), orig_project) elseif VERSION >= v"1.2-" @@ -56,7 +56,7 @@ TestEnv.activate("ConstraintSolver") do @eval using Combinatorics end - @test isdefined(@__MODULE__, :Combinatorics) + @test Base.invokelatest(isdefined, @__MODULE__, :Combinatorics) # We use endswith here because on MacOS GitHub runners for some reasons the paths are slightly different # We also skip on Windows because it is using 8 character shortened paths in one case diff --git a/test/activate_set.jl b/test/activate_set.jl index 3794ab3..7809d7e 100644 --- a/test/activate_set.jl +++ b/test/activate_set.jl @@ -14,10 +14,10 @@ @test orig_load_path == Base.LOAD_PATH @eval using StaticArrays # From ChainRulesCore [extras] Project.toml - @test isdefined(@__MODULE__, :StaticArrays) + @test Base.invokelatest(isdefined, @__MODULE__, :StaticArrays) @eval using Compat # from ChainRulesCore Project.toml - @test isdefined(@__MODULE__, :StaticArrays) + @test Base.invokelatest(isdefined, @__MODULE__, :Compat) finally Pkg.activate(orig_project_toml_path) # No longer is enviroment active @@ -49,7 +49,7 @@ @test orig_load_path == Base.LOAD_PATH @eval using CSV - @test isdefined(@__MODULE__, :CSV) + @test Base.invokelatest(isdefined, @__MODULE__, :CSV) finally Pkg.activate(orig_project_toml_path) @@ -73,7 +73,7 @@ @test orig_load_path == Base.LOAD_PATH @eval using JSON - @test isdefined(@__MODULE__, :JSON) + @test Base.invokelatest(isdefined, @__MODULE__, :JSON) finally Pkg.activate(orig_project_toml_path)