[devtools] show DeprecationWarning during test execution
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 20 May 2016 14:43:19 +0200
changeset 11266 ea25d87a8537
parent 11265 ce04184fbf90
child 11267 c2e7fd344b90
[devtools] show DeprecationWarning during test execution They are not shown by default since python 2.7
cubicweb/devtools/testlib.py
--- a/cubicweb/devtools/testlib.py	Fri May 20 11:09:46 2016 +0200
+++ b/cubicweb/devtools/testlib.py	Fri May 20 14:43:19 2016 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -20,6 +20,7 @@
 
 import sys
 import re
+import warnings
 from os.path import dirname, join, abspath
 from math import log
 from contextlib import contextmanager
@@ -58,6 +59,9 @@
 else:
     from unittest import TestCase
 
+# in python 2.7, DeprecationWarning are not shown anymore by default
+warnings.filterwarnings('default', category=DeprecationWarning)
+
 
 # provide a data directory for the test class ##################################