It's pretty a pretty common annoyance to generate plots and then not know which ones are new and which ones you generated some other time. Also, it's common when iterating on a test you're writing to change the parametrizations and therefore leave a bunch of stale plots behind that are no longer valid. All to say that it would be nice to have a command line option that would remove all of the existing plots in the plot directory before generating the plots for the current run. Something like
pytest --plots-clear --plots
would clear all the plots first, then generate new ones.
It's pretty a pretty common annoyance to generate plots and then not know which ones are new and which ones you generated some other time. Also, it's common when iterating on a test you're writing to change the parametrizations and therefore leave a bunch of stale plots behind that are no longer valid. All to say that it would be nice to have a command line option that would remove all of the existing plots in the plot directory before generating the plots for the current run. Something like
would clear all the plots first, then generate new ones.