Rev 2: python-routes doesn't play nice with bzr's lazy_regex code. in http://bzr.arbash-meinel.com/plugins/u1dbtest

John Arbash Meinel john at arbash-meinel.com
Mon Nov 28 15:25:32 UTC 2011


At http://bzr.arbash-meinel.com/plugins/u1dbtest

------------------------------------------------------------
revno: 2
revision-id: john at arbash-meinel.com-20111128152524-545ve537n1gbnoz3
parent: john at arbash-meinel.com-20111104160247-3bb5ehhxzx5417pi
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: u1dbtest
timestamp: Mon 2011-11-28 16:25:24 +0100
message:
  python-routes doesn't play nice with bzr's lazy_regex code.
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2011-11-04 16:02:47 +0000
+++ b/__init__.py	2011-11-28 15:25:24 +0000
@@ -63,7 +63,7 @@
             randomize=None, exclude=None, strict=False,
             load_list=None, starting_with=None, subunit=False,
             lsprof_tests=False):
-        from bzrlib import tests
+        from bzrlib import tests, lazy_regex
 
         self.additional_selftest_args = {}
         if testspecs_list is not None:
@@ -81,6 +81,13 @@
                 and getattr(sys.stdout, 'fileno', None) is not None):
                 import msvcrt
                 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+        # It turns out that the 'python-routes' package assumes you can do:
+        # r = re.compile(some_string)
+        # re.match(r, ...)
+        # Which breaks with lazy_regex because the 'r' thing isn't a simple
+        # string or a re class.
+        # So disable it before we load any u1db code.
+        lazy_regex.reset_compile()
         def test_suite_factory():
             loader = testtools.run.defaultTestLoaderCls()
             return loader.discover('.', 'test*.py', '.')



More information about the bazaar-commits mailing list