Skip to content

Commit

Permalink
Test suite: restore the original ENV at the end of the test suite (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Sep 5, 2022
1 parent b8bfd64 commit 3cbbd86
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module PkgTestsOuter

original_depot_path = copy(Base.DEPOT_PATH)
original_load_path = copy(Base.LOAD_PATH)
original_env = copy(ENV)

module PkgTestsInner

Expand Down Expand Up @@ -83,4 +84,11 @@ empty!(Base.LOAD_PATH)
append!(Base.DEPOT_PATH, original_depot_path)
append!(Base.LOAD_PATH, original_load_path)

for k in setdiff(collect(keys(ENV)), collect(keys(original_env)))
delete!(ENV, k)
end
for (k, v) in pairs(original_env)
ENV[k] = v
end

end # module

0 comments on commit 3cbbd86

Please sign in to comment.