aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman_pgp/testing/layers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mailman_pgp/testing/layers.py b/src/mailman_pgp/testing/layers.py
index fb8a3ec..9f80248 100644
--- a/src/mailman_pgp/testing/layers.py
+++ b/src/mailman_pgp/testing/layers.py
@@ -19,6 +19,7 @@ import os
from os.path import isfile
from mailman.testing.layers import (ConfigLayer, RESTLayer, SMTPLayer)
+from sqlalchemy.exc import SQLAlchemyError
from mailman_pgp.config import config
from mailman_pgp.database import transaction
@@ -51,7 +52,10 @@ def reset_pgp_soft():
with contextlib.closing(config.db.engine.connect()) as con:
trans = con.begin()
for table in reversed(Base.metadata.sorted_tables):
- con.execute(table.delete())
+ try:
+ con.execute(table.delete())
+ except SQLAlchemyError:
+ pass
trans.commit()