Permalink
Browse files

Skip that test under certain conditions.

  • Loading branch information...
1 parent 184647b commit 9b3f65be22b59eafb007cc8771f026895c3fbdd3 @ralphbean ralphbean committed Mar 8, 2014
Showing with 19 additions and 0 deletions.
  1. +19 −0 fedmsg/tests/test_meta.py
View
@@ -51,6 +51,24 @@ def inner(self):
return wrapper
+def skip_if_fedmsg_meta_FI_is_present(f):
+ """ A test decorator that will skip if fedmsg_meta_fedora_infrastructure
+ is installed.
+
+ The presence of that module will screw up some tests.
+ """
+ def _wrapper(self, *args, **kw):
+ try:
+ import fedmsg_meta_fedora_infrastructure
+ raise SkipTest("fedmsg_meta_FI is present")
+ except ImportError:
+ pass
+
+ return f(self, *args, **kw)
+
+ return make_decorator(f)(_wrapper)
+
+
class TestForWarning(unittest.TestCase):
def setUp(self):
dirname = os.path.abspath(os.path.dirname(__file__))
@@ -61,6 +79,7 @@ def setUp(self):
self.config['topic_prefix'] = 'org.fedoraproject'
self.config['topic_prefix_re'] = '^org\.fedoraproject\.(dev|stg|prod)'
+ @skip_if_fedmsg_meta_FI_is_present
def test_for_no_plugins(self):
""" Test that we print a warning if no plugin is installed """
messages = []

0 comments on commit 9b3f65b

Please sign in to comment.