tests: Disable some tests so they don't break when ./configure --without-libvirt

This commit is contained in:
Richard W.M. Jones
2017-02-23 12:36:53 +00:00
parent a7bd499244
commit 45e046dac9
9 changed files with 48 additions and 12 deletions

View File

@@ -29,6 +29,7 @@ from .tests_helper import *
guestsdir = os.environ['guestsdir']
@skipUnlessConfiguredWithLibvirt()
@skipUnlessLibvirtHasCPointer()
class Test910Libvirt(unittest.TestCase):
def test_libvirt(self):

View File

@@ -1,5 +1,6 @@
# libguestfs Python bindings
# Copyright (C) 2016 Red Hat Inc.
# Copyright (C) 2016-2017 Red Hat Inc.
# @configure_input@
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,6 +28,14 @@ else:
int_type = long
def skipUnlessConfiguredWithLibvirt():
"""
Skip the current class/method if ./configure --without-libvirt
"""
if "@LIBVIRT_LIBS@" == "":
return unittest.skip("configured --without-libvirt")
return lambda func: func
def skipUnlessLibvirtHasCPointer():
"""
Skip the current class/method if: