Skip to content

Commit

Permalink
Lift isdefined checks out of __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-arya committed Jul 14, 2023
1 parent cc0fe9d commit 6da1cc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TestUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ we allow specifying `copy_input=true` to allow for this behaviour in tests by co
"""
function test_plan_adjoint end

function __init__()
if isdefined(Base, :get_extension) && isdefined(Base.Experimental, :register_error_hint)
if isdefined(Base, :get_extension) && isdefined(Base.Experimental, :register_error_hint)
function __init__()
# Better error message if users forget to load Test
Base.Experimental.register_error_hint(MethodError) do io, exc, _, _
if (exc.f === test_real_fft || exc.f === test_complex_fft) && Base.get_extension(AbstractFFTs, :AbstractFFTsTestExt) === nothing
Expand Down

0 comments on commit 6da1cc3

Please sign in to comment.