Is there a way to run tests prerequisite once and clean up in the end in whole unit test run

634 Views Asked by At

I'm running series of testcases in multiple files, but I want to run the prereq and cleanup only once through out the run, please let me know is there a way to do it?

1

There are 1 best solutions below

0
sureshvv On

py.test -> session scoped fixtures and their finalization should help you

You can use conftest.py to code your fixture.