Testing obsolete interfaces

Jan Hudec bulb at ucw.cz
Tue May 9 21:32:56 BST 2006


On Tue, May 09, 2006 at 16:11:08 -0400, Aaron Bentley wrote:
> Jan Hudec wrote:
> > Hello,
> > 
> > The test suite prints all deprecation warnings on the error output. But isn't
> > it supposed to test deprecated interfaces as long as they are kept around?
> 
> Whenever an interface becomes deprecated, none of the core code should
> use it.  Printing deprecation warnings during test runs is a good way to
> catch that when it does happen.
> 
> It's hard to distinguish between tests of deprecated functions and tests
> of undeprecated functions that happen to call deprecated functions,
> which means we're getting error output even for deprecations warnings we
> expect.
> 
> Perhaps we need a decorator to suppress expected deprecations warnings
> for test cases that exercise deprecated interfaces.

Another option, given the fact that the decorator always takes **kwargs,
would be to implement a TEST=True extra parameter, that the decorator would
remove and skip the warning if it's present... That way the tests of
deprecated interfaces would be explicitly marked. Disadvantage of decorators
is, that some testcases are quite long, so they may call some deprecated
functions on purpose and others in error.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060509/ab3ceaaf/attachment.pgp 


More information about the bazaar mailing list