Skip to content

Commit

Permalink
Fix PermissionErrors in Windows wallet unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Feb 5, 2024
1 parent 1961bf7 commit 78a5599
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ def database_init(dbname=DATABASE_NAME):
else:
dburi = os.path.join(str(BCL_DATABASE_DIR), '%s.sqlite' % dbname)
if os.path.isfile(dburi):
os.remove(dburi)
try:
os.remove(dburi)
except PermissionError:
db_obj = Db(dburi)
db_obj.drop_db(True)
db_obj.session.close()
db_obj.engine.dispose()
return dburi


Expand Down

0 comments on commit 78a5599

Please sign in to comment.