1. Olemis Lang
  2. bloodhound-mq

Commits

Olemis Lang  committed d4259df

BH i18n #694 (refs #706 and #707): Move patches to the folders for their corresponding tickets at i.a.o/bh

  • Participants
  • Parent commits 206d424
  • Branches t694_bh_i18n

Comments (0)

Files changed (5)

File series

View file
  • Ignore whitespace
-t694/t694_r1536966_test_discovery_logging.diff
-t694/t694_r1536966_AssertRaisesContext_import.diff
+t707/t707_r1536966_test_discovery_logging.diff
+t706/t706_r1536966_AssertRaisesContext_import.diff
 t694/t694_r1534486_bloodhound_i18n.diff

File t694/t694_r1536966_AssertRaisesContext_import.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent 7176b7acc46936d5ab50bd083558f1bf80877652
-BH Multiproduct #xxx: Fix _AssertRaisesContext import
-
-diff -r 7176b7acc469 bloodhound_multiproduct/tests/env.py
---- a/bloodhound_multiproduct/tests/env.py	Wed Oct 30 05:27:50 2013 +0000
-+++ b/bloodhound_multiproduct/tests/env.py	Thu Oct 31 10:12:42 2013 -0500
-@@ -26,7 +26,6 @@
- from sqlite3 import OperationalError
- from tests import unittest
- from types import MethodType
--from unittest.case import _AssertRaisesContext
- 
- from trac.config import Option
- from trac.core import Component, ComponentMeta
-@@ -42,6 +41,7 @@
- from multiproduct.env import ProductEnvironment
- from multiproduct.model import Product
- 
-+_AssertRaisesContext = unittest.case._AssertRaisesContext
- 
- class ProductEnvironmentStub(ProductEnvironment):
-     r"""A product environment slightly tweaked for testing purposes

File t694/t694_r1536966_test_discovery_logging.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent 7176b7acc46936d5ab50bd083558f1bf80877652
-BH Multiproduct #xxx: Log import errors catched during test discovery process
-
-diff -r 7176b7acc469 bloodhound_multiproduct/tests/__init__.py
---- a/bloodhound_multiproduct/tests/__init__.py	Wed Oct 30 05:27:50 2013 +0000
-+++ b/bloodhound_multiproduct/tests/__init__.py	Thu Oct 31 18:39:11 2013 -0500
-@@ -16,6 +16,7 @@
- #  specific language governing permissions and limitations
- #  under the License.
- 
-+import logging
- import sys
- from collections import deque
- from fnmatch import fnmatch
-@@ -50,12 +51,17 @@
-         """
-         pending = deque([(package_or_requirement, self, True)])
-         tests = []
-+        log = logging.getLogger('bh.tests')
-+        if len(log.handlers) == 0:
-+            # Configure logger instance. otherwise messages won't be displayed
-+            self._logging_basic_config(log)
-         while pending:
-             mdlnm, loader, isdir = pending.popleft()
-             try:
-                 mdl = self._get_module_from_name(mdlnm)
-             except (ImportError, ValueError):
--                # Skip packages not having __init__.py
-+                # Log import error and skip packages not having __init__.py
-+                log.exception('Detected package %s but import failed', mdlnm)
-                 continue
-             loader = getattr(mdl, self.testLoaderAttribute, None) or loader
-             if not (isdir and ignore_subpkg_root):
-@@ -79,6 +85,13 @@
-                         pending.append((submdlnm, loader, False))
-         return self.suiteClass(tests)
- 
-+    def _logging_basic_config(self, log):
-+        # See logging.basicConfig
-+        hdlr = logging.StreamHandler()
-+        fmt = logging.Formatter(logging.BASIC_FORMAT, None)
-+        hdlr.setFormatter(fmt)
-+        log.addHandler(hdlr)
-+
-     def _get_module_from_name(self, name):
-         __import__(name)
-         return sys.modules[name]

File t706/t706_r1536966_AssertRaisesContext_import.diff

View file
  • Ignore whitespace
+# HG changeset patch
+# Parent 31267f13da621bf4c03a05098cc30b5c7deb9de7
+BH Multiproduct #706: Fix _AssertRaisesContext import
+
+diff -r 31267f13da62 bloodhound_multiproduct/tests/env.py
+--- a/bloodhound_multiproduct/tests/env.py	Fri Nov 01 13:31:16 2013 -0500
++++ b/bloodhound_multiproduct/tests/env.py	Fri Nov 01 13:31:45 2013 -0500
+@@ -26,7 +26,6 @@
+ from sqlite3 import OperationalError
+ from tests import unittest
+ from types import MethodType
+-from unittest.case import _AssertRaisesContext
+ 
+ from trac.config import Option
+ from trac.core import Component, ComponentMeta
+@@ -42,6 +41,7 @@
+ from multiproduct.env import ProductEnvironment
+ from multiproduct.model import Product
+ 
++_AssertRaisesContext = unittest.case._AssertRaisesContext
+ 
+ class ProductEnvironmentStub(ProductEnvironment):
+     r"""A product environment slightly tweaked for testing purposes

File t707/t707_r1536966_test_discovery_logging.diff

View file
  • Ignore whitespace
+# HG changeset patch
+# Parent cec1e940716ff830cd3f30443c6cf6bf39de664a
+BH Multiproduct #707: Log import errors catched during test discovery process
+
+diff -r cec1e940716f bloodhound_multiproduct/tests/__init__.py
+--- a/bloodhound_multiproduct/tests/__init__.py	Thu Oct 31 07:15:42 2013 +0000
++++ b/bloodhound_multiproduct/tests/__init__.py	Fri Nov 01 13:31:16 2013 -0500
+@@ -16,6 +16,7 @@
+ #  specific language governing permissions and limitations
+ #  under the License.
+ 
++import logging
+ import sys
+ from collections import deque
+ from fnmatch import fnmatch
+@@ -50,12 +51,17 @@
+         """
+         pending = deque([(package_or_requirement, self, True)])
+         tests = []
++        log = logging.getLogger('bh.tests')
++        if len(log.handlers) == 0:
++            # Configure logger instance. otherwise messages won't be displayed
++            self._logging_basic_config(log)
+         while pending:
+             mdlnm, loader, isdir = pending.popleft()
+             try:
+                 mdl = self._get_module_from_name(mdlnm)
+             except (ImportError, ValueError):
+-                # Skip packages not having __init__.py
++                # Log import error and skip packages not having __init__.py
++                log.exception('Detected package %s but import failed', mdlnm)
+                 continue
+             loader = getattr(mdl, self.testLoaderAttribute, None) or loader
+             if not (isdir and ignore_subpkg_root):
+@@ -79,6 +85,13 @@
+                         pending.append((submdlnm, loader, False))
+         return self.suiteClass(tests)
+ 
++    def _logging_basic_config(self, log):
++        # See logging.basicConfig
++        hdlr = logging.StreamHandler()
++        fmt = logging.Formatter(logging.BASIC_FORMAT, None)
++        hdlr.setFormatter(fmt)
++        log.addHandler(hdlr)
++
+     def _get_module_from_name(self, name):
+         __import__(name)
+         return sys.modules[name]