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

add local to testset vars that should be local #34282

Merged
merged 1 commit into from
Jan 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ function testset_beginend(args, tests, source)
# action (such as reporting the results)
ex = quote
_check_testset($testsettype, $(QuoteNode(testsettype.args[1])))
ts = $(testsettype)($desc; $options...)
local ts = $(testsettype)($desc; $options...)
# this empty loop is here to force the block to be compiled,
# which is needed for backtrace scrubbing to work correctly.
while false; end
Expand All @@ -1109,7 +1109,7 @@ function testset_beginend(args, tests, source)
# cannot be used as it changes slightly the semantic of @testset,
# by wrapping the body in a function
local RNG = default_rng()
oldrng = copy(RNG)
local oldrng = copy(RNG)
try
# RNG is re-seeded with its own seed to ease reproduce a failed test
Random.seed!(RNG.seed)
Expand Down Expand Up @@ -1195,7 +1195,7 @@ function testset_forloop(args, testloop, source)
end
end
quote
arr = Vector{Any}()
local arr = Vector{Any}()
local first_iteration = true
local ts
local RNG = default_rng()
Expand Down