summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest_xgps_deps.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/test_xgps_deps.py b/test_xgps_deps.py
index d6138328..cb9448ea 100755
--- a/test_xgps_deps.py
+++ b/test_xgps_deps.py
@@ -1,8 +1,17 @@
#!/usr/bin/env python
+"""Test imports needed by X11-based tools."""
+
from __future__ import print_function
+import os
import sys
+# Keep Gtk from trying to launch X11.
+# Pylint seems to defeat this hack, but we can live with that.
+os.environ['DISPLAY'] = ''
+
+# pylint: disable=unused-import,wrong-import-position
+
import cairo
import gi
@@ -12,8 +21,7 @@ except (AttributeError, ValueError):
# Explain the reason for the exception, then reraise
print('*** Need PyGObject V3 or later, and Gtk3 ***', file=sys.stderr)
raise
-from gi.repository import GObject # pylint: disable=wrong-import-position
-# Skip the imports that require X11
-### from gi.repository import Gtk # pylint: disable=wrong-import-position
-### from gi.repository import Gdk # pylint: disable=wrong-import-position
-### from gi.repository import Pango # pylint: disable=wrong-import-position
+from gi.repository import GObject
+from gi.repository import Gtk
+from gi.repository import Gdk
+from gi.repository import Pango