Skip to content

Commit

Permalink
Throw if test_end_expr not a :block expression
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrobinson251 committed Oct 3, 2024
1 parent fc7845b commit 91a60fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ReTestItems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function runtests(
(0 memory_threshold 1) || throw(ArgumentError("`memory_threshold` must be between 0 and 1, got $(repr(memory_threshold))"))
testitem_timeout > 0 || throw(ArgumentError("`testitem_timeout` must be a positive number, got $(repr(testitem_timeout))"))
timeout_profile_wait >= 0 || throw(ArgumentError("`timeout_profile_wait` must be a non-negative number, got $(repr(timeout_profile_wait))"))
test_end_expr.head === :block || throw(ArgumentError("`test_end_expr` must be a `:block` expression, got a `$(repr(test_end_expr.head))` expression"))
# If we were given paths but none were valid, then nothing to run.
!isempty(paths) && isempty(paths′) && return nothing
ti_filter = TestItemFilter(shouldrun, tags, name)
Expand Down
4 changes: 4 additions & 0 deletions test/integrationtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1503,4 +1503,8 @@ else
end # VERSION
end

@testset "`test_end_expr` must be `:block`" begin
@test_throws "`test_end_expr` must be a `:block` expression" runtests(; test_end_expr=:(@assert false))
end

end # integrationtests.jl testset

0 comments on commit 91a60fd

Please sign in to comment.