Skip to content

Commit 194a38b

Browse files
authored
add local to testset vars that should be local (#34282)
1 parent 831e21b commit 194a38b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/Test/src/Test.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ function testset_beginend(args, tests, source)
11001100
# action (such as reporting the results)
11011101
ex = quote
11021102
_check_testset($testsettype, $(QuoteNode(testsettype.args[1])))
1103-
ts = $(testsettype)($desc; $options...)
1103+
local ts = $(testsettype)($desc; $options...)
11041104
# this empty loop is here to force the block to be compiled,
11051105
# which is needed for backtrace scrubbing to work correctly.
11061106
while false; end
@@ -1109,7 +1109,7 @@ function testset_beginend(args, tests, source)
11091109
# cannot be used as it changes slightly the semantic of @testset,
11101110
# by wrapping the body in a function
11111111
local RNG = default_rng()
1112-
oldrng = copy(RNG)
1112+
local oldrng = copy(RNG)
11131113
try
11141114
# RNG is re-seeded with its own seed to ease reproduce a failed test
11151115
Random.seed!(RNG.seed)
@@ -1195,7 +1195,7 @@ function testset_forloop(args, testloop, source)
11951195
end
11961196
end
11971197
quote
1198-
arr = Vector{Any}()
1198+
local arr = Vector{Any}()
11991199
local first_iteration = true
12001200
local ts
12011201
local RNG = default_rng()

0 commit comments

Comments
 (0)