diff --git a/src/SciMLTesting.jl b/src/SciMLTesting.jl index ee285f9..62c66ee 100644 --- a/src/SciMLTesting.jl +++ b/src/SciMLTesting.jl @@ -46,7 +46,7 @@ using Pkg: Pkg using PrecompileTools: @compile_workload, @setup_workload using TOML: TOML using Test: Test, @testset, @test, @test_broken -using SafeTestsets: SafeTestsets, @safetestset +using SafeTestsets: SafeTestsets using Aqua: Aqua using ExplicitImports: ExplicitImports # REPL provides the public `@doc` lookup used on Julia 1.10, before `Docs.hasdoc` @@ -1891,7 +1891,7 @@ function _run_body(body; label::AbstractString = "Group") GlobalRef(SafeTestsets, Symbol("@safetestset")), LineNumberNode(@__LINE__, @__FILE__), string(label), - Expr(:block, :(include($path))), + Expr(:block, Expr(:call, :include, path)), ) Core.eval(Main, expr) elseif _callable(body) diff --git a/test/runtests.jl b/test/runtests.jl index 190dc9c..2311fd3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -264,6 +264,8 @@ function Test.finish(ts::ProbeTestSet) return ts end +using ExplicitImports + @testset "SciMLTesting" begin @testset "current_group" begin # Default when unset. @@ -917,6 +919,11 @@ end @test FakeExplicitImports.PUBLIC_CALLED[] == (VERSION >= v"1.11") end + @testset "SciMLTesting source analyzability" begin + @test ExplicitImports.check_no_implicit_imports(SciMLTesting) === nothing + @test ExplicitImports.check_no_stale_explicit_imports(SciMLTesting) === nothing + end + @testset "generated enum modules are excluded from source analysis" begin @test SciMLTesting._generated_enum_modules(EnumFixture) == (EnumFixture.Generated,) kwargs = SciMLTesting._explicit_imports_kwargs(