pyvista / pytest-pyvista

Plugin to test PyVista plot outputs
https://pytest.pyvista.org
MIT License
13 stars 5 forks source link

Add test-level option to choose image name for comparison #109

Open MatthewFlamm opened 9 months ago

MatthewFlamm commented 9 months ago

This would enable reducing duplicate images in tests. For example, tests in https://github.com/pyvista/pyvista/pull/5428 generate multiple images that are duplicates of one another. It could be something like:

def test_identical_images(verify_image_cache):
    verify_image_cache.file_compare = "identical_images"
    # generate image with first plot and compare to "identical_images.png"
    verify_image_cache.file_compare = "identical_images"
    # generate image with second plot and compare to same "identical_images.png"