From b4de353c8510b270c786f57da8bcfa28c985f439 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Jan 2015 19:39:23 +0200 Subject: [PATCH] tests: Import gobject in a way that allows failures It looks like the gobject module does not get installed by default for Python at least on Ubuntu server, so modify the D-Bus test case files to import this in a way that allows other test cases to be run even without gobject module being installed. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 2 +- tests/hwsim/test_dbus_old.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index 0ba417f19..43132831d 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -5,13 +5,13 @@ # See README for more details. import binascii -import gobject import logging logger = logging.getLogger() import subprocess import time try: + import gobject import dbus dbus_imported = True except ImportError: diff --git a/tests/hwsim/test_dbus_old.py b/tests/hwsim/test_dbus_old.py index e677e78c0..8a76636ee 100644 --- a/tests/hwsim/test_dbus_old.py +++ b/tests/hwsim/test_dbus_old.py @@ -4,11 +4,11 @@ # This software may be distributed under the terms of the BSD license. # See README for more details. -import gobject import logging logger = logging.getLogger() try: + import gobject import dbus dbus_imported = True except ImportError: