| ============================= test session starts ==============================
|
| platform linux -- Python 3.8.20, pytest-8.0.2, pluggy-1.4.0 -- /root/.pyenv/versions/3.8.20/bin/python
|
| cachedir: .pytest_cache
|
| metadata: {'Python': '3.8.20', 'Platform': 'Linux-4.4.0-x86_64-with-glibc2.34', 'Packages': {'pytest': '8.0.2', 'pluggy': '1.4.0'}, 'Plugins': {'reportlog': '0.1.1', 'html': '2.1.1', 'metadata': '3.1.1', 'cov': '4.1.0', 'json-report': '1.5.0'}, 'JAVA_HOME': '/root/.sdkman/candidates/java/current'}
|
| rootdir: /app
|
| configfile: pytest.ini
|
| testpaths: tests/
|
| plugins: reportlog-0.1.1, html-2.1.1, metadata-3.1.1, cov-4.1.0, json-report-1.5.0
|
| collecting ... collected 3 items
|
|
|
| tests/test_nltk_utils.py::TestNltkUtils::test_tokenize PASSED [1/3]
|
| tests/test_nltk_utils.py::TestNltkUtils::test_stem FAILED [2/3]
|
| tests/test_nltk_utils.py::TestNltkUtils::test_bag_of_words FAILED [3/3]
|
|
|
| =================================== FAILURES ===================================
|
| ___________________________ TestNltkUtils.test_stem ____________________________
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:84: in __load
|
| root = nltk.data.find(f"{self.subdir}/{zip_name}")
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/data.py:583: in find
|
| raise LookupError(resource_not_found)
|
| E LookupError:
|
| E **********************************************************************
|
| E Resource [93mstopwords [0m not found.
|
| E Please use the NLTK Downloader to obtain the resource:
|
| E
|
| E [31m>>> import nltk
|
| E >>> nltk.download('stopwords')
|
| E [0m
|
| E For more information see: https://www.nltk.org/data.html
|
| E
|
| E Attempted to load [93mcorpora/stopwords.zip/stopwords/ [0m
|
| E
|
| E Searched in:
|
| E - '/root/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/share/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/lib/nltk_data'
|
| E - '/usr/share/nltk_data'
|
| E - '/usr/local/share/nltk_data'
|
| E - '/usr/lib/nltk_data'
|
| E - '/usr/local/lib/nltk_data'
|
| E **********************************************************************
|
|
|
| During handling of the above exception, another exception occurred:
|
| tests/test_nltk_utils.py:14: in test_stem
|
| result = [stem(w) for w in ["organize", "organizes", "organizing"]]
|
| tests/test_nltk_utils.py:14: in <listcomp>
|
| result = [stem(w) for w in ["organize", "organizes", "organizing"]]
|
| src/nltk_utils.py:33: in stem
|
| return SnowballStemmer("english", ignore_stopwords=True).stem(word.lower())
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/stem/snowball.py:108: in __init__
|
| self.stemmer = stemmerclass(ignore_stopwords)
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/stem/snowball.py:140: in __init__
|
| for word in stopwords.words(language):
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:121: in __getattr__
|
| self.__load()
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:86: in __load
|
| raise e
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:81: in __load
|
| root = nltk.data.find(f"{self.subdir}/{self.__name}")
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/data.py:583: in find
|
| raise LookupError(resource_not_found)
|
| E LookupError:
|
| E **********************************************************************
|
| E Resource [93mstopwords [0m not found.
|
| E Please use the NLTK Downloader to obtain the resource:
|
| E
|
| E [31m>>> import nltk
|
| E >>> nltk.download('stopwords')
|
| E [0m
|
| E For more information see: https://www.nltk.org/data.html
|
| E
|
| E Attempted to load [93mcorpora/stopwords [0m
|
| E
|
| E Searched in:
|
| E - '/root/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/share/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/lib/nltk_data'
|
| E - '/usr/share/nltk_data'
|
| E - '/usr/local/share/nltk_data'
|
| E - '/usr/lib/nltk_data'
|
| E - '/usr/local/lib/nltk_data'
|
| E **********************************************************************
|
| _______________________ TestNltkUtils.test_bag_of_words ________________________
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:84: in __load
|
| root = nltk.data.find(f"{self.subdir}/{zip_name}")
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/data.py:583: in find
|
| raise LookupError(resource_not_found)
|
| E LookupError:
|
| E **********************************************************************
|
| E Resource [93mstopwords [0m not found.
|
| E Please use the NLTK Downloader to obtain the resource:
|
| E
|
| E [31m>>> import nltk
|
| E >>> nltk.download('stopwords')
|
| E [0m
|
| E For more information see: https://www.nltk.org/data.html
|
| E
|
| E Attempted to load [93mcorpora/stopwords.zip/stopwords/ [0m
|
| E
|
| E Searched in:
|
| E - '/root/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/share/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/lib/nltk_data'
|
| E - '/usr/share/nltk_data'
|
| E - '/usr/local/share/nltk_data'
|
| E - '/usr/lib/nltk_data'
|
| E - '/usr/local/lib/nltk_data'
|
| E **********************************************************************
|
|
|
| During handling of the above exception, another exception occurred:
|
| tests/test_nltk_utils.py:20: in test_bag_of_words
|
| result = bag_of_words('b', ['a', 'b'])
|
| src/nltk_utils.py:46: in bag_of_words
|
| sentence_words = [stem(word) for word in tokenized_sentence]
|
| src/nltk_utils.py:46: in <listcomp>
|
| sentence_words = [stem(word) for word in tokenized_sentence]
|
| src/nltk_utils.py:33: in stem
|
| return SnowballStemmer("english", ignore_stopwords=True).stem(word.lower())
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/stem/snowball.py:108: in __init__
|
| self.stemmer = stemmerclass(ignore_stopwords)
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/stem/snowball.py:140: in __init__
|
| for word in stopwords.words(language):
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:121: in __getattr__
|
| self.__load()
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:86: in __load
|
| raise e
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/corpus/util.py:81: in __load
|
| root = nltk.data.find(f"{self.subdir}/{self.__name}")
|
| /root/.pyenv/versions/3.8.20/lib/python3.8/site-packages/nltk/data.py:583: in find
|
| raise LookupError(resource_not_found)
|
| E LookupError:
|
| E **********************************************************************
|
| E Resource [93mstopwords [0m not found.
|
| E Please use the NLTK Downloader to obtain the resource:
|
| E
|
| E [31m>>> import nltk
|
| E >>> nltk.download('stopwords')
|
| E [0m
|
| E For more information see: https://www.nltk.org/data.html
|
| E
|
| E Attempted to load [93mcorpora/stopwords [0m
|
| E
|
| E Searched in:
|
| E - '/root/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/share/nltk_data'
|
| E - '/root/.pyenv/versions/3.8.20/lib/nltk_data'
|
| E - '/usr/share/nltk_data'
|
| E - '/usr/local/share/nltk_data'
|
| E - '/usr/lib/nltk_data'
|
| E - '/usr/local/lib/nltk_data'
|
| E **********************************************************************
|
| ---------------- generated report log file: reports/report.json ----------------
|
| ------------- generated html file: file:///app/reports/report.html -------------
|
| --------------------------------- JSON report ----------------------------------
|
| report saved to: .report.json
|
| =========================== short test summary info ============================
|
| FAILED tests/test_nltk_utils.py::TestNltkUtils::test_stem - LookupError:
|
| FAILED tests/test_nltk_utils.py::TestNltkUtils::test_bag_of_words - LookupErr...
|
| ========================= 2 failed, 1 passed in 1.09s ==========================
|