Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extendable registry not cleaned up in case of error during the setup process #392

Closed
lmignon opened this issue Nov 7, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@lmignon
Copy link
Contributor

lmignon commented Nov 7, 2023

Module

extendable_fastapi

Describe the bug

When you override the setUpClass of FastAPITransactionCase in your own est class and an exception occurs in your override after the call to super, the registry used by the extendable addon is not reset at its initial state.

Expected behavior
Once the test registry for extendable is initialized in the setUpClass method of FastAPITransactionCase, we must ensure that any error that occurs into the code reset the registry at its initial state.

@lmignon lmignon added the bug Something isn't working label Nov 7, 2023
lmignon added a commit to acsone/rest-framework that referenced this issue Nov 7, 2023
Register the cleanup of the extendable registry just after its initialisation by calling the  method from unittest. If setUpClass() fails, meaning that tearDownClass() is not called, then any cleanup functions added with a call to  will still be called.

refs OCA#392
@lmignon lmignon closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant