From a17fdcf0cf80c664277e821016649064159ab07b Mon Sep 17 00:00:00 2001 From: Kleber Noel <42589399+klebster2@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:54:29 +0000 Subject: [PATCH] pylint --- python/plugin.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python/plugin.py b/python/plugin.py index ed7d143..eeaeae0 100644 --- a/python/plugin.py +++ b/python/plugin.py @@ -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" @@ -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]