[PATCH] small test_selftest fixes

Aaron Bentley aaron.bentley at utoronto.ca
Fri Sep 29 15:59:20 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> Alexander Belchenko wrote:
> 
>>test_selftest fixes: if you test run_bzr_subprocess then don't load
>>plugins.
>>
>>Otherwise if some plugins cannot be loaded with tested version of bzr
>>you have garbage in stderr that unrelated to the test itself.
>>
> 
> 
> If we want to use this sort of behavior, I think it should be a specific
> parameter on run_bzr_subprocess() which defaults to --no-plugins.
> 
> Something like:
> 
> def run_bzr_subprocess(*args, **kwargs):
> 
>   enable_plugins = kwargs.get('enable_plugins', False)
>   if not enable_plugins:
>     args = args + ('--no-plugins',)
> 
> Or something like that. Running around adding '--no-plugins' everywhere
> only works until someone adds a new test, and forgets to do it.

Well, I've been thinking about this in another context, and it seems
like the most API-stable way is:

if 'enable_plugins' not in kwargs:
    deprecation_warning('enable_plugins is now required')
    enable_plugins = True
else:
    enable_plugins = kwargs['enable_plugins']

After leaving it out has been deprecated for a while, you can change it
to default False.

> So +1 to the concept, but I think the implementation needs to be a
> little different.

Also, it might be wise to disable aliases at the same time.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFFHTTI0F+nu1YWqI0RAnAoAJ92Tm3OwFCs6sfp6sgJQO9WQDZw5ACdH8CN
Agi0XpQGoN9ugxql1RAJ/YM=
=Lm8M
-----END PGP SIGNATURE-----




More information about the bazaar mailing list