Skip to content

Commit

Permalink
hide test imports for non-lindera test run
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrh committed Feb 18, 2024
1 parent 7ea1d8f commit 051e790
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/test_lindera.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import pytest
pytestmark = pytest.mark.lindera

from tantivy import SchemaBuilder, Index, Document, lindera
from tantivy import SchemaBuilder, Index, Document


@pytest.mark.parametrize("mode", [
lindera.LNormal(),
lindera.LDecompose(),
"normal",
"decompose",
])
def test_basic(mode):
# breakpoint()
# The import is here so that the non-lindera tests
# can run without lindera installed.
from tantivy import lindera

if mode == "normal":
mode = lindera.LNormal()
else:
mode = lindera.LDecompose()

sb = SchemaBuilder()
sb.add_text_field("title", stored=True, tokenizer_name="lang_ja")
schema = sb.build()
Expand Down

0 comments on commit 051e790

Please sign in to comment.