[pytest-dev] How can I suppress cleanups when a test fails

Ronny Pfannschmidt opensource at ronnypfannschmidt.de
Thu Apr 15 16:57:01 EDT 2021


Hi Christopher,

if you use the tmpdir/tmp_path fixtures pytest provides,
just don't do additional cleanup, pytest keeps the last 3 basetemps 
around precisely for that use-case and drops older ones


-- Ronny

Am 15.04.21 um 21:56 schrieb Eliot, Christopher:
>
> My test suit generates some intermediate files and other resources 
> which typically would be deleted upon termination of the test.  
> However, if there is a failure, I would like to leave them in place to 
> help in diagnosing the failure.
>
> Is there a clean way to do this?
>
> I’m already using a fixture to do cleanup, so I’m prepared to use some 
> aspect of the fixture if that’s appropriate.
>
> Thanks,
>
> Topher Eliot
>
>
> _______________________________________________
> pytest-dev mailing list
> pytest-dev at python.org
> https://mail.python.org/mailman/listinfo/pytest-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/pytest-dev/attachments/20210415/51eaeedb/attachment.html>


More information about the pytest-dev mailing list