You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2023/05/21 16:28:12 UTC
[couchdb] 02/02: mango: remove redundant text service checks from the tests
This is an automated email from the ASF dual-hosted git repository.
jaydoane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 649f473103d78306efbd9c34cc3edc6b403f037e
Author: Gabor Pali <ga...@ibm.com>
AuthorDate: Sun May 21 02:32:58 2023 +0200
mango: remove redundant text service checks from the tests
The result of the `mango.has_text_service()` checks is implicitly
forecasted by the `@unittest.skipUnless` annotations in the head of
the class declaration. Hence they are not needed anymore.
---
src/mango/test/04-key-tests.py | 3 +--
src/mango/test/05-index-selection-test.py | 8 +++-----
src/mango/test/06-basic-text-test.py | 3 +--
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/mango/test/04-key-tests.py b/src/mango/test/04-key-tests.py
index 0cc410321..998f17ee5 100644
--- a/src/mango/test/04-key-tests.py
+++ b/src/mango/test/04-key-tests.py
@@ -48,8 +48,7 @@ class KeyTests(mango.DbPerClass):
super(KeyTests, klass).setUpClass()
klass.db.save_docs(TEST_DOCS, w=3)
klass.db.create_index(["type"], ddoc="view")
- if mango.has_text_service():
- klass.db.create_text_index(ddoc="text")
+ klass.db.create_text_index(ddoc="text")
def run_check(self, query, check, fields=None, indexes=None):
if indexes is None:
diff --git a/src/mango/test/05-index-selection-test.py b/src/mango/test/05-index-selection-test.py
index d12f076fd..a4c15608a 100644
--- a/src/mango/test/05-index-selection-test.py
+++ b/src/mango/test/05-index-selection-test.py
@@ -249,8 +249,7 @@ class TextIndexSelectionTests(mango.UserDocsTests):
@classmethod
def setUpClass(klass):
super(TextIndexSelectionTests, klass).setUpClass()
- if mango.has_text_service():
- user_docs.add_text_indexes(klass.db, {})
+ user_docs.add_text_indexes(klass.db, {})
def test_with_text(self):
resp = self.db.find(
@@ -315,9 +314,8 @@ class MultiTextIndexSelectionTests(mango.UserDocsTests):
@classmethod
def setUpClass(klass):
super(MultiTextIndexSelectionTests, klass).setUpClass()
- if mango.has_text_service():
- klass.db.create_text_index(ddoc="foo", analyzer="keyword")
- klass.db.create_text_index(ddoc="bar", analyzer="email")
+ klass.db.create_text_index(ddoc="foo", analyzer="keyword")
+ klass.db.create_text_index(ddoc="bar", analyzer="email")
def test_fallback_to_json_with_multi_text(self):
resp = self.db.find(
diff --git a/src/mango/test/06-basic-text-test.py b/src/mango/test/06-basic-text-test.py
index a3fe383d6..03891a840 100644
--- a/src/mango/test/06-basic-text-test.py
+++ b/src/mango/test/06-basic-text-test.py
@@ -573,8 +573,7 @@ class NumStringTests(mango.DbPerClass):
def setUpClass(klass):
super(NumStringTests, klass).setUpClass()
klass.db.recreate()
- if mango.has_text_service():
- klass.db.create_text_index()
+ klass.db.create_text_index()
# not available for python 2.7.x
def isFinite(num):