diff --git a/python/t/test820RHBZ912499.py b/python/t/test820RHBZ912499.py index 60509dc6a..f008f0c74 100644 --- a/python/t/test820RHBZ912499.py +++ b/python/t/test820RHBZ912499.py @@ -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() diff --git a/python/t/tests_helper.py.in b/python/t/tests_helper.py.in index a024a4d62..91d1f8e85 100644 --- a/python/t/tests_helper.py.in +++ b/python/t/tests_helper.py.in @@ -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