TestItemRunner.jl icon indicating copy to clipboard operation
TestItemRunner.jl copied to clipboard

Early exit from `@testitem`

Open MilesCranmer opened this issue 1 year ago • 2 comments

Often in my code I will have stuff like:

@testitem "my test" begin
    if VERSION >= v"1.8"
        using MyPkg
        do_stuff()
    end
end

It could be nice to have a way to exit early from a test instead, like

@testitem "my test" begin
    if VERSION < v"1.8"
        @testitembreak
    end
    using MyPkg
    do_stuff()
end

MilesCranmer avatar Jul 21 '24 18:07 MilesCranmer

I was planning to adopt the skip option that ReTestItems.jl has, I think that would solve this problem? skip would accept an expression that gets evaluated.

davidanthoff avatar Jul 21 '24 21:07 davidanthoff

Nice! Yeah that would be perfect.

MilesCranmer avatar Jul 21 '24 21:07 MilesCranmer