-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Project.toml structure and suppressor #39
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #39 +/- ##
=====================================
Coverage 6.02% 6.02%
=====================================
Files 1 1
Lines 83 83
=====================================
Hits 5 5
Misses 78 78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Agreed, I stopped using |
For what it's worth, the eval hoops would have to remain there as well, you would still have to interpolate a string into the module or write out the suppressor dependency, since the problem is really that the |
Sure, that's fine. Though can we simplify the current PR by putting So ideally, we should be able to write it as something like: @safetestset "$file" for file in files
using Suppressor: @suppress
@suppress include(file)
end with a new EDIT: Which could then be defined for convenience as: @safeexampleset "$file" for file in files
include(file)
end as you suggested in the first post. |
Let me doublecheck, I was playing around with that this morning and somehow couldn't get that to work, but it might be because I was doing something else wrong. |
Yeah, that doesn't actually work. The problem is that safetestset expands to: julia> @eval module $(gensym())
using Test, SafeTestsets
@testset "test.jl" begin
using Suppressor: @suppress
@suppress include("path/test.jl")
end
end
ERROR: LoadError: UndefVarError: `@suppress` not defined in `Main.var"##232"`
Suggestion: check for spelling errors or missing imports. The problem is the placement of the @testset "$name" begin
module $(gensym())
include(...)
end
end (I didn't check if Linking the following: |
Gotcha, thanks for checking. If @safetestset setup=(using Suppressors: @suppress) begin
@suppress include("path/test.jl")
end |
julia> @testset begin
module MyTest
using Test
@test 1 == 1
@test 1==2
end
end
ERROR: syntax: "module" expression not at top level
Stacktrace:
[1] top-level scope
@ REPL[4]:1 This definitely doesn't work, so that kind of scratches this attempt. |
That seems fine. The part that made me uncomfortable about that is that it is hardcoded to |
As discussed with @mtfishman, we switch to the other convention of specifying test dependencies, using a
test/Project.toml
file instead of the[extras]
section in the main project file.Simultaneously, I fixed an issue where the examples testsets were being suppressed.
As a remark, at this point it might become cleaner to define our own
@safetestset
which supports interpolation, and@safeexampleset
which suppresses the output. TestExtras.jl might be a convenient place to put this.Closes #35
Closes #36