diff --git a/base_rest_demo/tests/common.py b/base_rest_demo/tests/common.py index 862c9993..4c32aca6 100644 --- a/base_rest_demo/tests/common.py +++ b/base_rest_demo/tests/common.py @@ -30,11 +30,7 @@ def setUpClass(cls): model_name="rest.service.registration", collection=collection ) cls.init_extendable_registry() - - @classmethod - def tearDownClass(cls): - cls.reset_extendable_registry() - super().tearDownClass() + cls.addClassCleanup(cls.reset_extendable_registry) # pylint: disable=W8106 def setUp(self): diff --git a/extendable_fastapi/README.rst b/extendable_fastapi/README.rst index 90f01100..26125ae1 100644 --- a/extendable_fastapi/README.rst +++ b/extendable_fastapi/README.rst @@ -7,7 +7,7 @@ Extendable Fastapi !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:959cc91eecf414d64d236339357d4322403e81584fb614d58d650f238d69fb93 + !! source digest: sha256:56a7bf28deffc71b10441926e9f063ba543c88d1c849dee1ae89b9500cdcda1f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/extendable_fastapi/readme/newsfragments/392.bugfix b/extendable_fastapi/readme/newsfragments/392.bugfix new file mode 100644 index 00000000..7eec2ed5 --- /dev/null +++ b/extendable_fastapi/readme/newsfragments/392.bugfix @@ -0,0 +1 @@ +Fix registry corruption when running tests difined in a class inheriting of the *FastAPITransactionCase* class if an error occurs in the *setUpClass* after the call to super(). diff --git a/extendable_fastapi/static/description/index.html b/extendable_fastapi/static/description/index.html index b24ad8f4..0daf1582 100644 --- a/extendable_fastapi/static/description/index.html +++ b/extendable_fastapi/static/description/index.html @@ -367,7 +367,7 @@
This addon is a technical addon used to allows the use of diff --git a/extendable_fastapi/tests/common.py b/extendable_fastapi/tests/common.py index 07de2bd9..3c5f496d 100644 --- a/extendable_fastapi/tests/common.py +++ b/extendable_fastapi/tests/common.py @@ -14,8 +14,4 @@ class FastAPITransactionCase(BaseFastAPITransactionCase, ExtendableMixin): def setUpClass(cls) -> None: super().setUpClass() cls.init_extendable_registry() - - @classmethod - def tearDownClass(cls) -> None: - cls.reset_extendable_registry() - super().tearDownClass() + cls.addClassCleanup(cls.reset_extendable_registry)