diff --git a/stix2/test/v21/test_datastore_relational_db.py b/stix2/test/v21/test_datastore_relational_db.py index b5b1b2a4..b9331baf 100644 --- a/stix2/test/v21/test_datastore_relational_db.py +++ b/stix2/test/v21/test_datastore_relational_db.py @@ -687,15 +687,13 @@ class TestClass: try: yield TestClass - except: # noqa: E722 + finally: ext_id = kwargs.get("extension_name") if not ext_id and len(args) >= 3: ext_id = args[2] _unregister("objects", TestClass._type, ext_id) - raise - @contextlib.contextmanager def _register_observable(*args, **kwargs): @@ -713,15 +711,13 @@ class TestClass: try: yield TestClass - except: # noqa: E722 + finally: ext_id = kwargs.get("extension_name") if not ext_id and len(args) >= 4: ext_id = args[3] _unregister("observables", TestClass._type, ext_id) - raise - # "Base" properties used to derive property variations for testing (e.g. in a # list, in a dictionary, in an embedded object, etc). Also includes sample