Add back api._twisted_publish with deprecation warning#375
Add back api._twisted_publish with deprecation warning#375mattiaverga wants to merge 1 commit intofedora-infra:developfrom
Conversation
aa24495 to
51bcaf4
Compare
Signed-off-by: Mattia Verga <mattia.verga@tiscali.it>
51bcaf4 to
4812c65
Compare
|
Ah, sorry about the breakage, I assumed that functions starting with an underscore would be private and people woudn't use them directly, but it's true that it can easily happen when mocking. |
|
The reason behind mocking But I originally created this PR because I was quite sure to have seen an example about mocking that method in fedora-messaging docs (which, however, I cannot find anymore...). So, I'm unsure if this can be useful to some other places other than bodhi or not. BTW about bodhi I solved the transition with a try / except AttributeError to handle both the new and old fedora-messaging versions. |
api._twisted_publishis (was) used for mocking tests.The removal of that method in 3.6.0 without previous warnings broke Bodhi tests (and I think other dependent packages too). The removal should be handled by provide a proper warning when the method is used and wait a decent amount of time before complete removal.
This PR adds back the deprecated method, which just emits a deprecation notice and routes to the new method, which seems 1:1 compatible.
I just don't know if the decorators should be applied to the deprecated method as well.