[warnings] explicitly ask to show DeprecationWarning in debug mode (closes #1942760)
as python 2.7 don't show DeprecationWarning by default
--- a/cwconfig.py Wed Sep 21 19:04:33 2011 +0200
+++ b/cwconfig.py Thu Sep 22 10:02:17 2011 +0200
@@ -144,7 +144,8 @@
from threading import Lock
from os.path import (exists, join, expanduser, abspath, normpath,
basename, isdir, dirname, splitext)
-from warnings import warn
+from warnings import warn, filterwarnings
+
from logilab.common.decorators import cached, classproperty
from logilab.common.deprecation import deprecated
from logilab.common.logging_ext import set_log_methods, init_log
@@ -696,6 +697,9 @@
return vregpath
def __init__(self, debugmode=False):
+ if debugmode:
+ # in python 2.7, DeprecationWarning are not shown anymore by default
+ filterwarnings('default', category=DeprecationWarning)
register_stored_procedures()
self._cubes = None
super(CubicWebNoAppConfiguration, self).__init__()