[pygobject/pygobject-3-42] tests: silence a deprecation warning with newer glib



commit ca83316884a2e3ebe3549ec80d11de79895cd00a
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sun Sep 19 16:26:14 2021 +0200

    tests: silence a deprecation warning with newer glib

 tests/test_glib.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_glib.py b/tests/test_glib.py
index 0a5cb3d6..19eff7f9 100644
--- a/tests/test_glib.py
+++ b/tests/test_glib.py
@@ -282,8 +282,10 @@ https://my.org/q?x=1&y=2
             self.assertGreaterEqual(micro, 0)
 
     def test_timezone_constructor(self):
-        timezone = GLib.TimeZone("+05:21")
-        self.assertEqual(timezone.get_offset(0), ((5 * 60) + 21) * 60)
+        with warnings.catch_warnings():
+            warnings.simplefilter('ignore', DeprecationWarning)
+            timezone = GLib.TimeZone("+05:21")
+            self.assertEqual(timezone.get_offset(0), ((5 * 60) + 21) * 60)
 
     def test_source_attach_implicit_context(self):
         context = GLib.MainContext.default()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]