Skip to content

Commit 718568c

Browse files
committed
Mute monkey-patching warning
1 parent 11b2974 commit 718568c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
88
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
99
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1010
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
11+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
1112
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1213

1314
[compat]
1415
ChainRulesCore = "1.11.2"
1516
Compat = "3, 4"
1617
FiniteDifferences = "0.12.12"
1718
MetaTesting = "0.1"
19+
Suppressor = "0.2.6"
1820
julia = "1"
1921

2022
[extras]

src/ChainRulesTestUtils.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using FiniteDifferences: to_vec
1010
using LinearAlgebra
1111
using Random
1212
using Test
13+
using Suppressor
1314

1415
export TestIterator
1516
export test_approx, test_scalar, test_frule, test_rrule, generate_well_conditioned_matrix
@@ -23,9 +24,11 @@ function __init__()
2324
# Try to disable backtrace scrubbing so that full failures are shown
2425
try
2526
isdefined(Test, :scrub_backtrace) || error("Test.scrub_backtrace not defined")
26-
# depending on julia version or one or the other of these will be hit
27-
@eval Test scrub_backtrace(bt,) = bt # make it do nothing
28-
@eval Test scrub_backtrace(bt, file_ts, file_t) = bt # make it do nothing
27+
@suppress begin # mute warning about monkey-patching
28+
# depending on julia version or one or the other of these will be hit
29+
@eval Test scrub_backtrace(bt,) = bt # make it do nothing
30+
@eval Test scrub_backtrace(bt, file_ts, file_t) = bt # make it do nothing
31+
end
2932
catch err
3033
@warn "Failed to monkey=patch scrub_backtrace. Code is functional but stacktraces may be less useful" exception=(err, catch_backtrace())
3134
end

0 commit comments

Comments
 (0)