> On Jun 13, 2016, at 4:26 AM, Adi Roiban <a...@roiban.ro> wrote:
> 
> Hi,
> 
> What is the best practice for deprecating a class in Twisted and writing 
> tests for it ... and updating existing tests.

We appear to have 'assertDeprecated' type methods scattered around the 
codebase.  These should be refactored into a single location.

> I think that the part in which the deprecation code is written, is well 
> understood and documented here
> 
> http://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html#classes
>  
> <http://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html#classes>
> 
> What is missing, is the part talking about how to test these changes and how 
> to update existing tests.

The thing that ends up being deprecated with the recommended technique here is 
the import of the class itself. So I think what's missing is the explanation 
that the import needs to be moved to test scope, not module scope within the 
tests.  The tests should also be separated out and dated so it's clear what to 
delete when the deprecation period expires, and removals are easy.

Does that answer your question sufficiently?

-glyph

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to