Skip to content

Commit f2344d6

Browse files
dsblankGaryGriffin
authored andcommitted
Drop redundant GTK/GDK pinning in filter rule test
PR gramps-project#950 pins GTK/GDK to 3.0 repo-wide via tests/__init__.py, so the per-file gi.require_version() calls here were redundant. Keep only the ImportError guard for hosts without PyGObject at all.
1 parent 6483ea6 commit f2344d6

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

FilterRules/tests/test_isfamilyfiltermatchevent.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,13 @@
4343
import unittest
4444

4545
# The addon imports Gtk at module load (via
46-
# gramps.gui.editors.filtereditor). Pin Gtk to 3.0 before any gramps
47-
# import (mirrors what gramps.grampsapp does at startup); otherwise
48-
# PyGObject loads GTK4 and the gramps.gui import chain crashes on
49-
# Gtk.IconSize.MENU (a GTK3-only enum). Skip cleanly if GTK 3 / PyGObject
50-
# aren't available.
46+
# gramps.gui.editors.filtereditor). GTK/GDK are already pinned to 3.0
47+
# repo-wide by tests/__init__.py (PR #950); skip cleanly here if
48+
# PyGObject isn't available at all.
5149
try:
5250
import gi
53-
54-
gi.require_version("Gtk", "3.0")
55-
gi.require_version("Gdk", "3.0")
56-
except (ImportError, ValueError, AttributeError) as err:
57-
raise unittest.SkipTest("GTK 3.0 / PyGObject not available: %s" % err)
51+
except ImportError as err:
52+
raise unittest.SkipTest("PyGObject not available: %s" % err)
5853

5954
# Addon root goes on sys.path so ``FilterRules.isfamilyfiltermatchevent``
6055
# resolves. The ``FilterRules`` directory lacks an __init__.py, so this

0 commit comments

Comments
 (0)