changeset 4989:fddc77cbe7bf

Xapian2009: Xapian related search test are skipped if xappy is not available.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Sun, 09 Aug 2009 14:04:35 +0200
parents f23b2823af31
children 6f87dbd8f895
files MoinMoin/search/_tests/test_search.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/_tests/test_search.py	Sun Aug 09 13:34:12 2009 +0200
+++ b/MoinMoin/search/_tests/test_search.py	Sun Aug 09 14:04:35 2009 +0200
@@ -12,7 +12,6 @@
 
 from MoinMoin.search import QueryError
 from MoinMoin.search.queryparser import QueryParser
-from MoinMoin.search import Xapian
 from MoinMoin import search
 from MoinMoin._tests import nuke_xapian_index, wikiconfig
 
@@ -156,7 +155,6 @@
 
 class TestXapianSearch(TestSearch):
     """ search: test Xapian indexing """
-    # XXX skip it if xapian is not available
 
     class Config(wikiconfig.Config):
 
@@ -164,6 +162,10 @@
 
     def setup_class(self):
         """ search: kicks off indexing for a single pages in Xapian """
+
+        py.test.importorskip('xappy')
+
+
         # This only tests that the call to indexing doesn't raise.
         nuke_xapian_index(self.request)
         idx = Xapian.Index(self.request)
@@ -175,10 +177,12 @@
 
 class TestXapianIndexingInNewThread(object):
     """ search: test Xapian indexing """
-    # XXX skip it if xapian is not available
 
     def setup_class(self):
         """ search: kicks off indexing for a single pages in Xapian """
+
+        py.test.importorskip('xappy')
+
         # This only tests that the call to indexing doesn't raise.
         nuke_xapian_index(self.request)
         idx = Xapian.Index(self.request)