diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-28 00:30:25 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-28 00:30:25 +0200 |
commit | 112436ff511aa795abad0d8fdb6a0ac22c652f99 (patch) | |
tree | f7eeff8a1bd238034f92845aa6a349649d357b0f /tests/test_openpgp.py | |
parent | 3208e8c89eac8edafc5ff4978308d998e7900307 (diff) | |
download | gemato-112436ff511aa795abad0d8fdb6a0ac22c652f99.tar.gz |
test_openpgp: Fix cleanup on exception
Diffstat (limited to 'tests/test_openpgp.py')
-rw-r--r-- | tests/test_openpgp.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py index ab0a82b..0519ae3 100644 --- a/tests/test_openpgp.py +++ b/tests/test_openpgp.py @@ -306,8 +306,10 @@ class OpenPGPCorrectKeyTest(unittest.TestCase): try: self.env.import_key(io.BytesIO(PUBLIC_KEY)) except gemato.exceptions.OpenPGPNoImplementation as e: + self.env.close() raise unittest.SkipTest(str(e)) except RuntimeError: + self.env.close() raise unittest.SkipTest('Unable to import OpenPGP key') def tearDown(self): @@ -568,8 +570,10 @@ class OpenPGPPrivateKeyTest(unittest.TestCase): try: self.env.import_key(io.BytesIO(PRIVATE_KEY)) except gemato.exceptions.OpenPGPNoImplementation as e: + self.env.close() raise unittest.SkipTest(str(e)) except RuntimeError: + self.env.close() raise unittest.SkipTest('Unable to import OpenPGP key') def tearDown(self): |