Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
klebster2 committed Nov 19, 2024
1 parent ad4ea0d commit a17fdcf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,8 @@ def synsets(

return MockWordNet()

def test_normalize_word():
def test_normalize_word(test_completer): # pylint: disable=redefined-outer-name
"""Test word normalization."""
test_completer = WordNetCompleter(wordnet_mock()) # type: ignore
assert (
test_completer._normalize_word( # pylint: disable=protected-access
"Test-Word"
Expand All @@ -480,15 +479,18 @@ def test_normalize_word():
== "testword"
)

def test_empty_input():
@pytest.fixture
def test_completer(wordnet_mock): # pylint: disable=redefined-outer-name
"""Create a WordNetCompleter instance for testing."""
return WordNetCompleter(wordnet_mock)

def test_empty_input(test_completer): # pylint: disable=redefined-outer-name
"""Test handling of empty input."""
test_completer = WordNetCompleter(wordnet_mock()) # type: ignore
assert not test_completer.get_completions("")
assert not test_completer.get_completions("a")

def test_basic_completion(wordnet_mock): # pylint: disable=redefined-outer-name
def test_basic_completion(test_completer): # pylint: disable=redefined-outer-name
"""Test basic completion functionality."""
test_completer = WordNetCompleter(wordnet_mock)
completions = test_completer.get_completions("test")
assert len(completions) > 0
completion = completions[0]
Expand Down

0 comments on commit a17fdcf

Please sign in to comment.