From 7527dddd7703f7c7f81eb131788ba22202788187 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Oct 04 2017 09:46:38 +0000 Subject: Skip test if rpmfluff is not available In some environments the rpmfluff package may not be available. In such cases the test relying on it should be skipped. Signed-off-by: Lubomír Sedlář --- diff --git a/tests/test_cli.py b/tests/test_cli.py index 7594739..c531c3d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -4,11 +4,18 @@ import gzip import hashlib import logging import os -import rpmfluff +try: + import rpmfluff +except ImportError: + rpmfluff = None import shutil import six import sys import tempfile +try: + import unittest2 as unittest +except ImportError: + import unittest from six.moves import configparser from six.moves import StringIO @@ -1106,6 +1113,7 @@ class TestFailureImportSrpm(CliTestCase): self.fail('import_srpm should fail if package repository is dirty.') +@unittest.skipUnless(rpmfluff, 'rpmfluff is not available') class TestImportSrpm(LookasideCacheMock, CliTestCase): def setUp(self):