Skip to content
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

Base.@deprecate_binding macro does not pass @test_deprecated tests #38780

Open
mzgubic opened this issue Dec 8, 2020 · 1 comment
Open

Base.@deprecate_binding macro does not pass @test_deprecated tests #38780

mzgubic opened this issue Dec 8, 2020 · 1 comment

Comments

@mzgubic
Copy link

mzgubic commented Dec 8, 2020

Compare deprecating functions with @deprecate

julia> using Test

julia> new() = "new"

julia> @deprecate old new

julia> old()
┌ Warning: `old` is deprecated, use `new` instead.
│   caller = top-level scope at REPL[8]:1
└ @ Core REPL[8]:1
"new"

julia> @test_deprecated old()
"new"

which passes the test,

to deprecating structs with @deprecate_binding

julia> struct New
           x
       end

julia> Base.@deprecate_binding Old New

julia> Old
WARNING: Main.Old is deprecated, use New instead.
  likely near REPL[13]:1
New

julia> @test_deprecated Old
WARNING: Main.Old is deprecated, use New instead.
  likely near REPL[11]:1
Log Test Failed at REPL[11]:1
  Expression: $(Expr(:escape, :Old))
  Log Pattern: (:warn, r"deprecated"i, Ignored(), :depwarn) match_mode = :any
  Captured Logs: 

ERROR: There was an error during testing

which does not.

I assume the reason is that @deprecate emits a real warning whereas @deprecate_binding just prints WARNING?

@glennmoy
Copy link
Contributor

FWIW this is still happening in master v"1.9.0-DEV.852". I might take a stab at fixing this if I have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants