From 112436ff511aa795abad0d8fdb6a0ac22c652f99 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sat, 28 Oct 2017 00:30:25 +0200 Subject: test_openpgp: Fix cleanup on exception --- tests/test_openpgp.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/test_openpgp.py') 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): -- cgit v1.2.3