[Pkg-bazaar-commits] ./bzr-gtk/unstable r163: Prevent test suite from causing default-encoding changes

Aaron Bentley abentley at panoramicfeedback.com
Fri Apr 10 07:49:40 UTC 2009


------------------------------------------------------------
revno: 163
committer: Aaron Bentley <abentley at panoramicfeedback.com>
branch nick: gtk
timestamp: Wed 2007-03-07 14:41:22 -0500
message:
  Prevent test suite from causing default-encoding changes
modified:
  __init__.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2007-03-07 13:58:23 +0000
+++ b/__init__.py	2007-03-07 19:41:22 +0000
@@ -435,6 +435,12 @@
 def test_suite():
     from unittest import TestSuite
     import tests
-    result = TestSuite()
-    result.addTest(tests.test_suite())
+    import sys
+    default_encoding = sys.getdefaultencoding()
+    try:
+        result = TestSuite()
+        result.addTest(tests.test_suite())
+    finally:
+        reload(sys)
+        sys.setdefaultencoding(default_encoding)
     return result



More information about the Pkg-bazaar-commits mailing list