Skip to content

Commit

Permalink
preserve original LOAD_PATH (#2748)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pangoraw authored Dec 13, 2023
1 parent 461f398 commit c999c73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/runner/Loader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ begin
import Pkg
popfirst!(LOAD_PATH)

local original_LP = LOAD_PATH
local original_LP = copy(LOAD_PATH)
local original_AP = Base.ACTIVE_PROJECT[]

# Path to our notebook boot package environment which is set by WorkspaceManager
Expand Down
14 changes: 14 additions & 0 deletions test/packages/Basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,20 @@ import Malt
end
end

@testset "Inherit load path" begin
notebook = Notebook([
Cell("import Pkg; Pkg.activate()"),
Cell("LOAD_PATH[begin]"),
Cell("LOAD_PATH[end]"),
])
🍭 = ServerSession()
update_run!(🍭, notebook, notebook.cells)
@test isnothing(notebook.nbpkg_ctx)
@test notebook.cells[2].output.body == sprint(Base.show, LOAD_PATH[begin])
@test notebook.cells[3].output.body == sprint(Base.show, LOAD_PATH[end])
WorkspaceManager.unmake_workspace((🍭, notebook))
end

Pkg.Registry.rm(pluto_test_registry_spec)
# Pkg.Registry.add("General")
end
Expand Down

0 comments on commit c999c73

Please sign in to comment.