Parcourir la source

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 <j@w1.fi>
Jouni Malinen il y a 10 ans
Parent
commit
b4de353c85
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      tests/hwsim/test_dbus.py
  2. 1 1
      tests/hwsim/test_dbus_old.py

+ 1 - 1
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:

+ 1 - 1
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: