Skip to content

Conversation

@thomaspaulb
Copy link

Otherwise monkey-patches could be added twice when instantiating new test classes.

…rts patches

Otherwise monkey-patches could be added twice when instantiating new test classes.
@OCA-git-bot
Copy link
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@sbidoul
Copy link
Member

sbidoul commented Jan 8, 2026

Is that due to a recent change or has this been there since like forever?

@sbidoul sbidoul added this to the 18.0 milestone Jan 8, 2026
@sbidoul sbidoul changed the title [FIX] test_queue_job: also add an _unregister_hook function that reverts patches [18.0][FIX] test_queue_job: also add an _unregister_hook function that reverts patches Jan 8, 2026
@thomaspaulb
Copy link
Author

Probably since 2021? https://github.com/OCA/queue/pull/275/files

I only ran into it because I backported your change from 18.0 that adds an extra test class, thus Odoo applies the hook twice; and in 16.0 there is still a test that checks if the warning that's emitted by the patched methods is emitted only once, and it was emitted twice. But in 18.0 it wouldn't be apparent because that test was removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants