diff options
Diffstat (limited to 'src/mailman_pgp/testing/layers.py')
| -rw-r--r-- | src/mailman_pgp/testing/layers.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mailman_pgp/testing/layers.py b/src/mailman_pgp/testing/layers.py index fb8a3ec..07eb386 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() @@ -60,10 +64,6 @@ def reset_pgp_soft(): # and subclass both it and the respective Mailman Core test layer. class PGPConfigLayer(ConfigLayer): @classmethod - def setUp(cls): - config.set('keypairs', 'autogenerate', 'no') - - @classmethod def tearDown(cls): reset_pgp_soft() |
