def pytest_runtest_teardown(item, nextitem): path = os.path.join( appdirs.user_data_dir(nkms.db.CONFIG_APPNAME), nkms.db.DB_NAME) if os.path.exists(path): shutil.rmtree(path)