[ANN] TestEnv.jl: Activate your test enviroment, so you can use your test dependencies

Less useful, yes. But still useful.
For a few reasons:

  1. some will keep supporting 1.0 forever (not many but some)
  2. some prefer the [extras] over the separate Project.toml (I know I do, as otherwise it is too easy to lost track and mistakenly install things both as main and test deps, and potentially with conflicting compat)
  3. The way to activate via hacking on your LOAD_PATH is kinda undocumented and people run into issues with it. See that thread. TestEnv uses a different mechanism that is basically what Pkg.test uses.
  4. TestEnv.activate() is nicer and easier to write than push!(Base.LOAD_PATH, joinpath(dirname(Base.active_project()), "test"))

But yeah, if using the LOAD_PATH way works for you and you are happy with it, then absolutely no reason to use TestEnv. :v:

5 Likes