[devtools] Use the pause_trace context manager instead of pause_tracing/resume_tracing
authorChristophe de Vienne <christophe@unlish.com>
Thu, 27 Nov 2014 12:11:29 +0100
changeset 10108 129af90b2364
parent 10107 1ef92a6193a8
child 10109 479190f019cc
[devtools] Use the pause_trace context manager instead of pause_tracing/resume_tracing The later were deprecated in logilab-common 0.63.1
__pkginfo__.py
cubicweb.spec
debian/control
devtools/testlib.py
--- a/__pkginfo__.py	Thu Oct 23 15:47:17 2014 +0200
+++ b/__pkginfo__.py	Thu Nov 27 12:11:29 2014 +0100
@@ -39,7 +39,7 @@
 ]
 
 __depends__ = {
-    'logilab-common': '>= 0.62.0',
+    'logilab-common': '>= 0.63.1',
     'logilab-mtconverter': '>= 0.8.0',
     'rql': '>= 0.31.2',
     'yams': '>= 0.40.0',
--- a/cubicweb.spec	Thu Oct 23 15:47:17 2014 +0200
+++ b/cubicweb.spec	Thu Nov 27 12:11:29 2014 +0100
@@ -20,7 +20,7 @@
 BuildArch:      noarch
 
 Requires:       %{python}
-Requires:       %{python}-logilab-common >= 0.62.0
+Requires:       %{python}-logilab-common >= 0.63.1
 Requires:       %{python}-logilab-mtconverter >= 0.8.0
 Requires:       %{python}-rql >= 0.31.2
 Requires:       %{python}-yams >= 0.40.0
--- a/debian/control	Thu Oct 23 15:47:17 2014 +0200
+++ b/debian/control	Thu Nov 27 12:11:29 2014 +0100
@@ -151,7 +151,7 @@
  graphviz,
  gettext,
  python-logilab-mtconverter (>= 0.8.0),
- python-logilab-common (>= 0.62.0),
+ python-logilab-common (>= 0.63.1),
  python-markdown,
  python-yams (>= 0.40.0),
  python-rql (>= 0.31.2),
--- a/devtools/testlib.py	Thu Oct 23 15:47:17 2014 +0200
+++ b/devtools/testlib.py	Thu Nov 27 12:11:29 2014 +0100
@@ -32,7 +32,7 @@
 import yams.schema
 
 from logilab.common.testlib import TestCase, InnerTest, Tags
-from logilab.common.pytest import nocoverage, pause_tracing, resume_tracing
+from logilab.common.pytest import nocoverage, pause_trace
 from logilab.common.debugger import Debugger
 from logilab.common.umessage import message_from_string
 from logilab.common.decorators import cached, classproperty, clear_cache, iclassmethod
@@ -572,18 +572,17 @@
     def setUp(self):
         # monkey patch send mail operation so emails are sent synchronously
         self._patch_SendMailOp()
-        pause_tracing()
-        previous_failure = self.__class__.__dict__.get('_repo_init_failed')
-        if previous_failure is not None:
-            self.skipTest('repository is not initialised: %r' % previous_failure)
-        try:
-            self._init_repo()
-            self.addCleanup(self._close_cnx)
-        except Exception as ex:
-            self.__class__._repo_init_failed = ex
-            raise
-        self.addCleanup(self._close_access)
-        resume_tracing()
+        with pause_trace():
+            previous_failure = self.__class__.__dict__.get('_repo_init_failed')
+            if previous_failure is not None:
+                self.skipTest('repository is not initialised: %r' % previous_failure)
+            try:
+                self._init_repo()
+                self.addCleanup(self._close_cnx)
+            except Exception as ex:
+                self.__class__._repo_init_failed = ex
+                raise
+            self.addCleanup(self._close_access)
         self.setup_database()
         self._admin_clt_cnx.commit()
         MAILBOX[:] = [] # reset mailbox