Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to check if a cached image isn't compared to an image during all tests #28

Open
MatthewFlamm opened this issue Jan 3, 2023 · 5 comments

Comments

@MatthewFlamm
Copy link
Contributor

It would be very useful to have an option to check that all cached images were compared during a test. This is a complement to checking that all comparisons have an image in the cache.

This is tricky if tests are skipped for any reason. So, it would be only useful if there is a canonical version for which no test is skipped. I'm not sure if this is the case today for pyvista. It is very possible that at least one plotting test is skipped on every vtk version. But, this could be useful for downstream libs that have less wide-open vtk version support.

@germa89
Copy link
Contributor

germa89 commented Sep 28, 2023

I believe this is fail_extra_image_cache argument is for... but I also believe it is fundamentally broken...

If I set fail_extra_image_cache=True, it should fail all the tests with RegressionFileNotFound (See #80)

and self.fail_extra_image_cache

@germa89
Copy link
Contributor

germa89 commented Sep 28, 2023

I think to have that feature, we are going to have to use os.listdir to cache the the image cache file names, and then at each test, pop each item.

The problem is to check at the end of the tests that there is no leftover.

@germa89
Copy link
Contributor

germa89 commented Sep 28, 2023

This might be a solution:

https://stackoverflow.com/a/35394239/6650211

@MatthewFlamm
Copy link
Contributor Author

I believe this is fail_extra_image_cache argument is for... but I also believe it is fundamentally broken...

I think it is a poor name for this argument. I think it does what the help message says

group.addoption(
"--fail_extra_image_cache",
action="store_true",
help="Enables failure if image cache does not exist.",
)

@germa89
Copy link
Contributor

germa89 commented Sep 28, 2023

I would propose to change the name then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants