-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deprecate conflicting @testset arguments #55174
Deprecate conflicting @testset arguments #55174
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the idea, thank you!
Unfortunately the tests in here don't seem to work as intended? At least they cause the CI tests to fail:
Error During Test at /cache/build/tester-amdci4-12/julialang/julia-master/julia-33da5bdd9b/share/julia/stdlib/v1.12/Test/test/runtests.jl:1734
Test threw exception
Expression: #= /cache/build/tester-amdci4-12/julialang/julia-master/julia-33da5bdd9b/share/julia/stdlib/v1.12/Test/test/runtests.jl:1734 =# @macroexpand #= /cache/build/tester-amdci4-12/julialang/julia-master/julia-33da5bdd9b/share/julia/stdlib/v1.12/Test/test/runtests.jl:1734 =# @testset("name1", "name2", begin
end)
Multiple descriptions provided to @testset. This may be disallowed in the future.
Stacktrace:
[1] _depwarn(msg::Any, funcsym::Any, force::Bool)
@ Base ./deprecated.jl:241
...
Error During Test at /cache/build/tester-amdci4-12/julialang/julia-master/julia-33da5bdd9b/share/julia/stdlib/v1.12/Test/test/runtests.jl:1737
Test threw exception
Expression: #= /cache/build/tester-amdci4-12/julialang/julia-master/julia-33da5bdd9b/share/julia/stdlib/v1.12/Test/test/runtests.jl:1737 =# @macroexpand #= /cache/build/tester-amdci4-12/julialang/julia-master/julia-33da5bdd9b/share/julia/stdlib/v1.12/Test/test/runtests.jl:1737 =# @testset(DefaultTestSet, DefaultTestSet, begin
end)
Multiple testset types provided to @testset. This may be disallowed in the future.
This is a great idea; definitely worth implementing. CI currently fails because we run tests with |
Tests pass for me locally indeed without |
Then You're looking for |
Thank you! I appreciate this deprecation. |
Currently `@testset` allows specifying multiple descriptions and testset types, and only the last one will take effect. The others will be silently ignored. This PR starts printing deprecation warnings whenever such conflicting arguments are provided.
Currently
@testset
allows specifying multiple descriptions and testset types, and only the last one will take effect. The others will be silently ignored.This PR starts printing deprecation warnings whenever such conflicting arguments are provided.
Ideally I would also propose fixing the order in which the arguments must be provided (currently order doesn't matter), but I've left that out at least for now since that's a more breaking change. Can put it in though if others are for it.