From fdbeace33a077116b145df633cb90c21bc3e9793 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 23 Oct 2020 00:05:40 +0200 Subject: [PATCH] fix jupyter (#3090) * fix jupyter * Update runtests.jl * Update runtests.jl --- src/ijulia.jl | 2 +- test/runtests.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ijulia.jl b/src/ijulia.jl index 4e543891..13fc3b2e 100644 --- a/src/ijulia.jl +++ b/src/ijulia.jl @@ -4,7 +4,7 @@ const use_local_plotlyjs = Ref(false) function _init_ijulia_plotting() # IJulia is more stable with local file - use_local_plotlyjs[] = isfile(plotly_local_file_path[]) + use_local_plotlyjs[] = plotly_local_file_path[] === nothing ? false : isfile(plotly_local_file_path[]) ENV["MPLBACKEND"] = "Agg" end diff --git a/test/runtests.jl b/test/runtests.jl index 6f7eacf3..be680676 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -11,7 +11,9 @@ import GeometryTypes, GeometryBasics using Dates using RecipesBase + @testset "Plotly standalone" begin + @test_nowarn Plots._init_ijulia_plotting() @test Plots.plotly_local_file_path[] === nothing temp = Plots.use_local_dependencies[] withenv("PLOTS_HOST_DEPENDENCY_LOCAL" => true) do @@ -19,6 +21,7 @@ using RecipesBase @test Plots.plotly_local_file_path[] isa String @test isfile(Plots.plotly_local_file_path[]) @test Plots.use_local_dependencies[] = true + @test_nowarn Plots._init_ijulia_plotting() end Plots.plotly_local_file_path[] = nothing Plots.use_local_dependencies[] = temp