Skip to content

Commit 6adb6aa

Browse files
committed
Add project logo and favicon, improve test data reset
Added logo and favicon images to documentation static assets. Updated DataFaker to clear records before inserting test data. Improved SQLite test fixture to handle file deletion errors gracefully.
1 parent 0586c9e commit 6adb6aa

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed
3.47 KB
Binary file not shown.
41.3 KB
Loading

sqlalchemy_upsert_kit/tests/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def prepare_existing_data(self, engine: sa.Engine):
214214
:param engine: SQLAlchemy engine for database operations
215215
"""
216216
with engine.connect() as conn:
217+
conn.execute(t_record.delete())
217218
conn.execute(t_record.insert(), self.existing_data)
218219
conn.commit()
219220

tests/sqlite/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ def clean_database(data_faker):
3131
Fixture to ensure clean database state for each test.
3232
"""
3333
dir_tmp.mkdir(parents=True, exist_ok=True)
34-
path_sqlite.unlink(missing_ok=True)
34+
try:
35+
path_sqlite.unlink(missing_ok=True)
36+
except:
37+
pass
3538
engine = sa.create_engine(f"sqlite:///{path_sqlite}")
3639
Base.metadata.create_all(engine)
3740
data_faker.prepare_existing_data(engine)

0 commit comments

Comments
 (0)