Closed Jutho closed 5 days ago
The reason I changed it back is because I cannot have the
@testset ... for b in backendlist
include("some_file_which_wants_to_use_b.jl")
end
pattern.
Aha, I see. I encountered this one myself as well, and came up with something like this: https://github.com/quantumghent/TensorKit.jl/blob/332c70c3a88c0fd62d6ea2fbe34a0743f50bf854/TensorKitSectors/test/testsetup.jl#L48-L53
See also this discussion.
I guess it's a good reason to not do it, and I can definitely work around it so it's not too important
Would it be useful to have that @include
definition in TestExtras.jl? In order not to have to copy paste it everywhere?
Maybe an additional note on the test structure as well, I find it convenient when the
@testset
calls that encapsulate an entire file are moved to the parent file. This ensures that nothing in the file escapes that scope (maybe we should consider using the safetestsets as well), and when you want to run individual tests (mostly in VSCode), the usual shortcuts for running code don't end up running the entire file, instead of single testsets