[MERGE] handle wacky plugin behavior in test suite

Aaron Bentley aaron.bentley at utoronto.ca
Thu Feb 15 16:19:37 GMT 2007


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

Hi all,

This patch attempts to fix misbehavior of the gtk plugin's test suite,
but seems generally applicable.

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.

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.

Solution: detect default-encoding changes, emit a warning, and reset the
 encoding to the original default.

While I have only experienced these problems with the gtk plugin in
particular, it's possible for other plugins to have the same kinds of
problems, so I think it makes sense to make bzr more robust against them.

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

iD8DBQFF1IgZ0F+nu1YWqI0RAlheAJoCypdmnwS60gs9IbaYgRum6PbPtwCfViMh
++GUzFmY7jEcAB80wEKQuXQ=
=Sk/j
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plugin-tests.patch
Type: text/x-patch
Size: 1683 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070215/19a09298/attachment-0001.bin 


More information about the bazaar mailing list