summaryrefslogtreecommitdiff
path: root/tests/test_glib.py
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-10-26 10:39:28 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-10-26 10:39:28 +0200
commitf976d05b04f26e733d19988e68989e340eb3a29e (patch)
treea0ca638ae47d9b2e95be4206f98c89d80468412d /tests/test_glib.py
parent366f5d2d3902c6293d0031e0b7dc5d6641a05ac7 (diff)
downloadpygobject-f976d05b04f26e733d19988e68989e340eb3a29e.tar.gz
Use a custom deprecation warning to make them visible by default
DeprecationWarning is not shown by default, and is thus rather useless for developers. Use a custom PyGIDeprecationWarning class and derive it from RuntimeWarning to make it visible.
Diffstat (limited to 'tests/test_glib.py')
-rw-r--r--tests/test_glib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_glib.py b/tests/test_glib.py
index f2f28aa9..b1e3fc40 100644
--- a/tests/test_glib.py
+++ b/tests/test_glib.py
@@ -6,6 +6,7 @@ import os.path
import warnings
from gi.repository import GLib
+from gi import PyGIDeprecationWarning
from compathelper import _unicode, _bytes
@@ -115,7 +116,7 @@ https://my.org/q?x=1&y=2
with warnings.catch_warnings(record=True) as warn:
warnings.simplefilter('always')
GLib.io_add_watch(r, GLib.IOCondition.IN, cb)
- self.assertTrue(issubclass(warn[0].category, DeprecationWarning))
+ self.assertTrue(issubclass(warn[0].category, PyGIDeprecationWarning))
ml = GLib.MainLoop()
GLib.timeout_add(10, lambda: os.write(w, b'a') and False)
@@ -138,7 +139,7 @@ https://my.org/q?x=1&y=2
with warnings.catch_warnings(record=True) as warn:
warnings.simplefilter('always')
GLib.io_add_watch(r, GLib.IOCondition.IN, cb, 'moo')
- self.assertTrue(issubclass(warn[0].category, DeprecationWarning))
+ self.assertTrue(issubclass(warn[0].category, PyGIDeprecationWarning))
ml = GLib.MainLoop()
GLib.timeout_add(10, lambda: os.write(w, b'a') and False)