-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
Currently, @testitem behaves quite different compared to regular @testset. It would be better to follow the latter as possible, at least in some useful ways:
- Early stopping. One can do
returnin@testset, and the testset stops executing. Meanwhile,returnseems to be a no-op in@testitem, quite surprisingly. - Local scope.
@testsetrun in local scope, while@testitemseems to have global scope. This difference manifests itself, for example, with warning for innocuous code like
o = 1
...
for i in 1:5
o = i
...
end
# warns:
# Warning: Assignment to `o` in soft scope is ambiguous because a global variable by the same name exists: `o` will be treated as a new local.I think both can be solved by wrapping code generated by @testitem into let ... end blocks.
franckgaga
Metadata
Metadata
Assignees
Labels
No labels