[MERGE] handle wacky plugin behavior in test suite

Jelmer Vernooij jelmer at samba.org
Thu Feb 15 17:27:08 GMT 2007

On Thu, 2007-02-15 at 11:19 -0500, Aaron Bentley wrote:
> Problem #1
> ==========
> gtk.test_suite can raise an ImportError (if cairo isn't installed)
> This causes 'bzr selftest' to always fail, regardless of whether you are
> trying to run tests from the gtk plugin.
> Solution: Catch ImportError, emit a warning, and skip that plugin's test
> suite.
Makes sense and is consistent with the behaviour when loading plugins.

> Problem #2
> ==========
> gtk.test_suite changes the system default encoding, even if it throws
> ImportError.  This causes tests expecting UnicodeDecode errors to fail.
>   (e.g.
> test_lockable_files.TestLockableFiles_TransportLock.test_read_write) The
> root cause of this problem appears to be PyGTK.  Because I am running
> Sarge, I have pygtk-2.6.3 installed.  It's quite possible that this has
> been fixed in a less-ancient version.
The GTK plugin doesn't actually make any changes to the encoding itself
(or at least, I can't find the code that does). It very much looks like
it's pygtk that does :-( 

In other words, there would be no way to fix the encoding in bzr-gtk

> Solution: detect default-encoding changes, emit a warning, and reset the
>  encoding to the original default.
I guess that would be the best attempt at fixing this, though I think
the fact that importing gtk or cairo stuff causes the encoding to change
is scary.



Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070215/f4dbd5bc/attachment.pgp 

More information about the bazaar mailing list