From 352df39026a271f42284066268b2b341b8b6b67a Mon Sep 17 00:00:00 2001 From: Thatcher Chamberlin Date: Sun, 6 Dec 2020 14:30:11 -0500 Subject: [PATCH] Added checks around display checks to see if we're in CI --- test/integration_dates.jl | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/test/integration_dates.jl b/test/integration_dates.jl index b4598d4c..4d43ccaf 100644 --- a/test/integration_dates.jl +++ b/test/integration_dates.jl @@ -13,7 +13,11 @@ using Plots, Test, Dates ref_xlims = (x[1].instant.periods.value, x[end].instant.periods.value) @test Plots.ylims(p) == ref_ylims @test Plots.xlims(p) == ref_xlims - @test isa(display(p), Nothing) == true + @static if haskey(ENV, "APPVEYOR") + @info "Skipping display tests on AppVeyor" + else + @test isa(display(p), Nothing) == true + end end # testset @testset "Date xlims" begin @@ -21,8 +25,16 @@ end # testset x=[Date(2019,11,i) for i in 1:10] span = (Date(2019,10,31), Date(2019,11,11)) + ref_xlims = map(date->date.instant.periods.value, span) + p = plot(x,y, xlims=span, widen = false) - @test isa(display(p), Nothing) == true + + @test Plots.xlims(p) == ref_xlims + @static if haskey(ENV, "APPVEYOR") + @info "Skipping display tests on AppVeyor" + else + @test isa(display(p), Nothing) == true + end end # testset @testset "DateTime xlims" begin @@ -30,6 +42,13 @@ end # testset x=[DateTime(2019,11,i,11) for i in 1:10] span = (DateTime(2019,10,31,11,59,59), DateTime(2019,11,11,12,01,15)) + ref_xlims = map(date->date.instant.periods.value, span) + p = plot(x,y, xlims=span, widen = false) - @test isa(display(p), Nothing) == true + @test Plots.xlims(p) == ref_xlims + @static if haskey(ENV, "APPVEYOR") + @info "Skipping display tests on AppVeyor" + else + @test isa(display(p), Nothing) == true + end end # testset