Skip to content

Commit

Permalink
delete_drivers_dir fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s.pirohov committed May 23, 2022
1 parent c49aede commit c8d4175
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

@pytest.fixture()
def delete_drivers_dir():
if os.path.exists(DEFAULT_USER_HOME_CACHE_PATH):
log(f"Delete {DEFAULT_USER_HOME_CACHE_PATH} folder")
shutil.rmtree(DEFAULT_USER_HOME_CACHE_PATH)
if os.path.exists(DEFAULT_PROJECT_ROOT_CACHE_PATH):
log(f"Delete {DEFAULT_PROJECT_ROOT_CACHE_PATH} folder")
shutil.rmtree(DEFAULT_PROJECT_ROOT_CACHE_PATH)
try:
if os.path.exists(DEFAULT_USER_HOME_CACHE_PATH):
log(f"Delete {DEFAULT_USER_HOME_CACHE_PATH} folder")
shutil.rmtree(DEFAULT_USER_HOME_CACHE_PATH)
if os.path.exists(DEFAULT_PROJECT_ROOT_CACHE_PATH):
log(f"Delete {DEFAULT_PROJECT_ROOT_CACHE_PATH} folder")
shutil.rmtree(DEFAULT_PROJECT_ROOT_CACHE_PATH)
except PermissionError as e:
print(f"Can not delete folder {e}")


@pytest.fixture(scope='function')
Expand Down

0 comments on commit c8d4175

Please sign in to comment.