I have productive code which creates config files in my $HOME
folder and to run my tests in an isolated environment I patch $HOME
in conftest.py
. Still I'm not sure if this works in general and maybe unthoughtful written test functions might break out.
To ensure the validity of my test suite I'd like to run a preliminary check of the respective files in $HOME
and I'd like to run a final check after running the test suite.
How can I achieve this with the "official" means of pytest
? I have a dirty hack which works but messes up reporting.
My test suite is correct now and this question is out of curiosity because I'd like to learn more about pytest
.
Addition: Same question, but different use case: I'd like to check if a 3rd-party plugin fullfills a version requierement. If this is not the case I'd like to show a message and stop py.test.