Pkg.jl: How to pass --depwarn=no to Pkg.test

Created on 11 Apr 2020  路  3Comments  路  Source: JuliaLang/Pkg.jl

This case might be too niche, but that i felt the need to record so we had the possibility written down.

As of https://github.com/JuliaLang/Pkg.jl/pull/1763 being merged
AFAICT we have no way to disable deprecation warnings during tests.

It could be that these deprecation warnings make one's tests too slow to complete, and right now there is nothing that can be done about it.

There are a number of ways we could fix this, largely around differentiating between default and no.
For example: (for sake of example using strings and excluding validation)

function Pkg.test(name; depwarn=nothing)
    if depwarn === nothing
        depwarn = (Base.JLOptions().depwarn == 2 ? "error" : "yes")
    end
    #...

That way if the user passes in depwarn="no" then it would not read the JLOptions and would just stick with "no"

Most helpful comment

All 3 comments

See the julia_args keyword in https://julialang.github.io/Pkg.jl/v1/api.html#Pkg.test.

Link is broken? It gives 404 for me.

Was this page helpful?
0 / 5 - 0 ratings