How to test plot recipes?

question
testing
plotting

#1

Plot recipes can reduce the test coverage considerably. For example, my coverage is currently at 76% and a big part of the remaining 24% is due to a plot recipe: https://codecov.io/gh/juliohm/ImageQuilting.jl/src/master/src/plot_recipes.jl

How should I go about testing plot recipes? Is there any way to design meaningful tests without human interaction?


#2

Or you could just call RecipesBase.apply_recipe with arguments that will
dispatch to your recipe.


#3

@tbreloff I really like the idea of VisualRegressionTests.jl, but apparently I am missing something about how it works. As you can see, the recipe itself is not covered by the tests that I wrote: https://codecov.io/gh/juliohm/ImageQuilting.jl/src/master/src/plot_recipes.jl


#4

It’s not clear to me how to use this way of testing. Should the first argument to RecipesBase.apply_recipe be an empty dictionary Dict{Symbol,Any}()?


#5

As a side comment, this coverage issue doesn’t exist anymore. It was fixed somewhere in Plots.jl or VisualRegressionTests.jl.