Different test dependencies for different Julia versions?

I want to make a package compatible with Julia 1.6, but some of my test dependencies are only compatible with Julia 1.10. How can I avoid requiring them when testing on 1.6?
The associated tests can be put inside an if VERSION >= v"1.10" but AFAICT pkg> test will still try to install every all the test dependencies. Is that best handled in the CI files?

Related question that I’m still curious about:

2 Likes

In TestEnv.jl’s own tests it is managed via using Pkg.add within the actual source code of the tests.
e.g

1 Like