julia-vscode / TestItemRunner.jl

Run Julia test items
MIT License
75 stars 12 forks source link

Early exit from `@testitem` #85

Open MilesCranmer opened 1 month ago

MilesCranmer commented 1 month ago

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
davidanthoff commented 1 month ago

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.

MilesCranmer commented 1 month ago

Nice! Yeah that would be perfect.