Rev 4696: Fix test failures with no C extensions loaded. in file:///home/vila/src/bzr/bugs/430749-no-extensions-warning/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Sep 17 08:09:01 BST 2009


At file:///home/vila/src/bzr/bugs/430749-no-extensions-warning/

------------------------------------------------------------
revno: 4696
revision-id: v.ladeuil+lp at free.fr-20090917070901-dse23w0f80r81q20
parent: pqm at pqm.ubuntu.com-20090916123002-46bfl24pa898h8cq
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 430749-no-extensions-warning
timestamp: Thu 2009-09-17 09:09:01 +0200
message:
  Fix test failures with no C extensions loaded.
  
  * bzrlib/tests/test_selftest.py:
  (TestActuallyStartBzrSubprocess.test_start_and_stop_bzr_subprocess_send_signal):Ignore
  missing extensions.
  
  * bzrlib/tests/blackbox/test_serve.py:
  (TestBzrServe.setUp): Ignore missing extensions.
  
  * bzrlib/tests/blackbox/test_locale.py:
  Fix imports.
  (TestLocale.test_log_C): Ignore missing extensions.
  
  * bzrlib/tests/blackbox/test_cat.py:
  Fix imports.
  (TestCat.test_cat_different_id): Ignore missing extensions.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-09-16 10:29:18 +0000
+++ b/NEWS	2009-09-17 07:09:01 +0000
@@ -125,6 +125,8 @@
   to be parameterised. This is not expected to break external use of test
   parameterisation, and is substantially faster. (Robert Collins)
 
+* The full test suite is expected to pass when the C extensions are not
+  present. (Vincent Ladeuil, #430749)
 
 bzr 2.0rc2
 ##########

=== modified file 'bzrlib/tests/blackbox/test_cat.py'
--- a/bzrlib/tests/blackbox/test_cat.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/blackbox/test_cat.py	2009-09-17 07:09:01 +0000
@@ -22,9 +22,13 @@
 import os
 import sys
 
-from bzrlib.tests.blackbox import TestCaseWithTransport
-
-class TestCat(TestCaseWithTransport):
+from bzrlib import (
+    config,
+    tests,
+    )
+
+
+class TestCat(tests.TestCaseWithTransport):
 
     def test_cat(self):
         tree = self.make_branch_and_tree('branch')
@@ -68,6 +72,7 @@
 
     def test_cat_different_id(self):
         """'cat' works with old and new files"""
+        config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
         tree = self.make_branch_and_tree('.')
         # the files are named after their path in the revision and
         # current trees later in the test case

=== modified file 'bzrlib/tests/blackbox/test_diff.py'
--- a/bzrlib/tests/blackbox/test_diff.py	2009-06-17 05:11:41 +0000
+++ b/bzrlib/tests/blackbox/test_diff.py	2009-09-17 07:09:01 +0000
@@ -21,11 +21,11 @@
 import os
 import re
 
-import bzrlib
-from bzrlib import workingtree
-from bzrlib.branch import Branch
-from bzrlib.tests import TestSkipped
-from bzrlib.tests.blackbox import ExternalBase
+from bzrlib import (
+    config,
+    tests,
+    workingtree,
+    )
 
 
 def subst_dates(string):
@@ -34,7 +34,7 @@
                   'YYYY-MM-DD HH:MM:SS +ZZZZ', string)
 
 
-class DiffBase(ExternalBase):
+class DiffBase(tests.TestCaseWithTransport):
     """Base class with common setup method"""
 
     def make_example_branch(self):
@@ -355,6 +355,7 @@
 
     def test_external_diff(self):
         """Test that we can spawn an external diff process"""
+        config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
         # We have to use run_bzr_subprocess, because we need to
         # test writing directly to stdout, (there was a bug in
         # subprocess.py that we had to workaround).
@@ -366,7 +367,7 @@
                                            universal_newlines=True,
                                            retcode=None)
         if 'Diff is not installed on this machine' in err:
-            raise TestSkipped("No external 'diff' is available")
+            raise tests.TestSkipped("No external 'diff' is available")
         self.assertEqual('', err)
         # We have to skip the stuff in the middle, because it depends
         # on time.time()

=== modified file 'bzrlib/tests/blackbox/test_locale.py'
--- a/bzrlib/tests/blackbox/test_locale.py	2009-08-17 22:16:49 +0000
+++ b/bzrlib/tests/blackbox/test_locale.py	2009-09-17 07:09:01 +0000
@@ -19,17 +19,20 @@
 import os
 import sys
 
-from bzrlib.tests import TestCaseWithTransport, TestSkipped
-
-
-class TestLocale(TestCaseWithTransport):
+from bzrlib import (
+    config,
+    tests,
+    )
+
+
+class TestLocale(tests.TestCaseWithTransport):
 
     def setUp(self):
         super(TestLocale, self).setUp()
 
         if sys.platform in ('win32',):
-            raise TestSkipped('Windows does not respond to the LANG'
-                              ' env variable')
+            raise tests.TestSkipped('Windows does not respond to the LANG'
+                                    ' env variable')
 
         tree = self.make_branch_and_tree('tree')
         self.build_tree(['tree/a'])
@@ -41,6 +44,7 @@
         self.tree = tree
 
     def test_log_C(self):
+        config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
         out, err = self.run_bzr_subprocess(
             '--no-aliases --no-plugins log -q --log-format=long tree',
                env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',

=== modified file 'bzrlib/tests/blackbox/test_serve.py'
--- a/bzrlib/tests/blackbox/test_serve.py	2009-09-08 03:31:31 +0000
+++ b/bzrlib/tests/blackbox/test_serve.py	2009-09-17 07:09:01 +0000
@@ -25,6 +25,7 @@
 import threading
 
 from bzrlib import (
+    config,
     errors,
     osutils,
     revision as _mod_revision,
@@ -42,6 +43,10 @@
 
 class TestBzrServe(TestCaseWithTransport):
 
+    def setUp(self):
+        super(TestBzrServe, self).setUp()
+        config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
+
     def assertInetServerShutsdownCleanly(self, process):
         """Shutdown the server process looking for errors."""
         # Shutdown the server: the server should shut down when it cannot read

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2009-09-09 15:27:48 +0000
+++ b/bzrlib/tests/test_selftest.py	2009-09-17 07:09:01 +0000
@@ -28,6 +28,7 @@
 from bzrlib import (
     branchbuilder,
     bzrdir,
+    config,
     debug,
     errors,
     lockdir,
@@ -2369,6 +2370,7 @@
         """finish_bzr_subprocess raises self.failureException if the retcode is
         not the expected one.
         """
+        config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
         process = self.start_bzr_subprocess(['wait-until-signalled'],
                                             skip_if_plan_to_signal=True)
         self.assertEqual('running\n', process.stdout.readline())



More information about the bazaar-commits mailing list