diff options
| author | J08nY | 2017-07-19 21:48:48 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-19 21:48:48 +0200 |
| commit | c1949ab33a6699965666eb2e0de0f92e6f0aea39 (patch) | |
| tree | dfe4669827c0171bfb45f5a50f6093216d05761b /src/mailman_pgp/testing/layers.py | |
| parent | 456bb91e2e8593b6a30c7776ef426594a01de755 (diff) | |
| parent | f0670baf7f66faab8ed4f16d393eea8a570f9630 (diff) | |
| download | mailman-pgp-c1949ab33a6699965666eb2e0de0f92e6f0aea39.tar.gz mailman-pgp-c1949ab33a6699965666eb2e0de0f92e6f0aea39.tar.zst mailman-pgp-c1949ab33a6699965666eb2e0de0f92e6f0aea39.zip | |
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() |
