mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
python: tests: Allow some tests to be skipped.
Currently test820RHBZ912499.py fails with libvirt because libvirt still doesn't work around qemu locking properly. Allow this test to be skipped on a temporary basis using SKIP_TEST820RHBZ912499_PY=1
This commit is contained in:
@@ -30,6 +30,7 @@ from .tests_helper import *
|
||||
|
||||
|
||||
# If the architecture doesn't support IDE, skip the test.
|
||||
@skipIfEnvironmentVariableSet("SKIP_TEST820RHBZ912499_PY")
|
||||
@skipUnlessArchMatches("(i.86|x86_64)")
|
||||
@skipUnlessGuestfsBackendIs('libvirt')
|
||||
@skipUnlessLibvirtHasCPointer()
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
# Utilities for the tests of the Python bindings.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
@@ -28,6 +29,16 @@ else:
|
||||
int_type = long
|
||||
|
||||
|
||||
def skipIfEnvironmentVariableSet(name):
|
||||
"""
|
||||
Skip the current class/method if the named environment variable
|
||||
is set to 1
|
||||
"""
|
||||
if os.environ.get(name, "") == "1":
|
||||
return unittest.skip("skipped by environment variable")
|
||||
return lambda func: func
|
||||
|
||||
|
||||
def skipUnlessConfiguredWithLibvirt():
|
||||
"""
|
||||
Skip the current class/method if ./configure --without-libvirt
|
||||
|
||||
Reference in New Issue
Block a user