flashtext
flashtext copied to clipboard
release version 2.5 on pypi does not include most test files
phase `build' succeeded after 0.6 seconds
starting phase `check'
running "python setup.py" with command "test" and parameters ()
WARNING: sphinx not available, not building docs
running test
============================= test session starts ==============================
platform linux -- Python 3.5.3 -- py-1.4.32 -- pytest-2.7.3
rootdir: /tmp/guix-build-python-flashtext-2.5.drv-0/flashtext-2.5, inifile:
collected 24 items
test/test_dictionary_loading.py .
test/test_extractor.py FF
test/test_file_load.py FF
test/test_kp_exceptions.py .......
test/test_kp_extract_span.py FF
test/test_kp_get_all_keywords.py .
test/test_kp_len.py FF
test/test_kp_term_in_kp.py ..
test/test_loading_keyword_list.py .
test/test_remove_keywords.py FFF
test/test_replacer.py F
=================================== FAILURES ===================================
__________________ TestKeywordExtractor.test_extract_keywords __________________
self = <test.test_extractor.TestKeywordExtractor testMethod=test_extract_keywords>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_extractor_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_extractor_test_cases.json'
test/test_extractor.py:12: FileNotFoundError
__________ TestKeywordExtractor.test_extract_keywords_case_sensitive ___________
self = <test.test_extractor.TestKeywordExtractor testMethod=test_extract_keywords_case_sensitive>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_extractor_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_extractor_test_cases.json'
test/test_extractor.py:12: FileNotFoundError
______________________ TestFileLoad.test_file_format_one _______________________
self = <test.test_file_load.TestFileLoad testMethod=test_file_format_one>
def test_file_format_one(self):
keyword_processor = KeywordProcessor()
> keyword_processor.add_keyword_from_file('test/keywords_format_one.txt')
test/test_file_load.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flashtext.keyword.KeywordProcessor object at 0x7ffff366a940>
keyword_file = 'test/keywords_format_one.txt'
def add_keyword_from_file(self, keyword_file):
"""To add keywords from a file
Args:
keyword_file : path to keywords file
Examples:
keywords file format can be like:
>>> # Option 1: keywords.txt content
>>> # java_2e=>java
>>> # java programing=>java
>>> # product management=>product management
>>> # product management techniques=>product management
>>> # Option 2: keywords.txt content
>>> # java
>>> # python
>>> # c++
>>> keyword_processor.add_keyword_from_file('keywords.txt')
Raises:
IOError: If `keyword_file` path is not valid
"""
if not os.path.isfile(keyword_file):
> raise IOError("Invalid file path {}".format(keyword_file))
E OSError: Invalid file path test/keywords_format_one.txt
flashtext/keyword.py:313: OSError
______________________ TestFileLoad.test_file_format_two _______________________
self = <test.test_file_load.TestFileLoad testMethod=test_file_format_two>
def test_file_format_two(self):
keyword_processor = KeywordProcessor()
> keyword_processor.add_keyword_from_file('test/keywords_format_two.txt')
test/test_file_load.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flashtext.keyword.KeywordProcessor object at 0x7ffff36632b0>
keyword_file = 'test/keywords_format_two.txt'
def add_keyword_from_file(self, keyword_file):
"""To add keywords from a file
Args:
keyword_file : path to keywords file
Examples:
keywords file format can be like:
>>> # Option 1: keywords.txt content
>>> # java_2e=>java
>>> # java programing=>java
>>> # product management=>product management
>>> # product management techniques=>product management
>>> # Option 2: keywords.txt content
>>> # java
>>> # python
>>> # c++
>>> keyword_processor.add_keyword_from_file('keywords.txt')
Raises:
IOError: If `keyword_file` path is not valid
"""
if not os.path.isfile(keyword_file):
> raise IOError("Invalid file path {}".format(keyword_file))
E OSError: Invalid file path test/keywords_format_two.txt
flashtext/keyword.py:313: OSError
__________________ TestKPExtractorSpan.test_extract_keywords ___________________
self = <test.test_kp_extract_span.TestKPExtractorSpan testMethod=test_extract_keywords>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_extractor_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_extractor_test_cases.json'
test/test_kp_extract_span.py:12: FileNotFoundError
___________ TestKPExtractorSpan.test_extract_keywords_case_sensitive ___________
self = <test.test_kp_extract_span.TestKPExtractorSpan testMethod=test_extract_keywords_case_sensitive>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_extractor_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_extractor_test_cases.json'
test/test_kp_extract_span.py:12: FileNotFoundError
________________ TestKPLen.test_remove_keywords_dictionary_len _________________
self = <test.test_kp_len.TestKPLen testMethod=test_remove_keywords_dictionary_len>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_remover_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_remover_test_cases.json'
test/test_kp_len.py:14: FileNotFoundError
______________________ TestKPLen.test_remove_keywords_len ______________________
self = <test.test_kp_len.TestKPLen testMethod=test_remove_keywords_len>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_remover_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_remover_test_cases.json'
test/test_kp_len.py:14: FileNotFoundError
___________________ TestKeywordRemover.test_remove_keywords ____________________
self = <test.test_remove_keywords.TestKeywordRemover testMethod=test_remove_keywords>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_remover_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_remover_test_cases.json'
test/test_remove_keywords.py:14: FileNotFoundError
__________ TestKeywordRemover.test_remove_keywords_dictionary_compare __________
self = <test.test_remove_keywords.TestKeywordRemover testMethod=test_remove_keywords_dictionary_compare>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_remover_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_remover_test_cases.json'
test/test_remove_keywords.py:14: FileNotFoundError
______________ TestKeywordRemover.test_remove_keywords_using_list ______________
self = <test.test_remove_keywords.TestKeywordRemover testMethod=test_remove_keywords_using_list>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_remover_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_remover_test_cases.json'
test/test_remove_keywords.py:14: FileNotFoundError
__________________ TestKeywordReplacer.test_replace_keywords ___________________
self = <test.test_replacer.TestKeywordReplacer testMethod=test_replace_keywords>
def setUp(self):
logger.info("Starting...")
> with open('test/keyword_extractor_test_cases.json') as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'test/keyword_extractor_test_cases.json'
test/test_replacer.py:13: FileNotFoundError
===================== 12 failed, 12 passed in 0.21 seconds =====================
phase `check' failed after 1.5 seconds
@ng-0 : What is the exact command that you ran?
And from which directory did you run it?
For me it is working fine:
➜ flashtext git:(master) python setup.py test
running test
=============================================================================================== test session starts ================================================================================================
platform darwin -- Python 3.5.4, pytest-3.1.3, py-1.4.34, pluggy-0.4.0
rootdir: /private/tmp/flashtext, inifile:
plugins: pep8-1.0.6, cov-2.5.1
collected 24 items
test/test_dictionary_loading.py .
test/test_extractor.py ..
test/test_file_load.py ..
test/test_kp_exceptions.py .......
test/test_kp_extract_span.py ..
test/test_kp_get_all_keywords.py .
test/test_kp_len.py ..
test/test_kp_term_in_kp.py ..
test/test_loading_keyword_list.py .
test/test_remove_keywords.py ...
test/test_replacer.py .
Closing as its no info provided on how to reproduce the same error.
Sorry, I will respond soon.
I'm just giving some intermediate feedback now: My main priority project takes lots of time in addition to my day activities. I'm not checking github very often, and setting up notification emails wouldn't work very well with the 3000 emails I already get per month.
Where I failed to provide more info was in the beginning of the post, usually I include this. In any case I think 3 days without reply and then just closing it is not good communication style. In an older and bigger project I give it 3 or sometimes 6 months of silence in the worst cases before I decide after pinging the person again. Until I can reproduce this (be able to spend time working on it) I can say it's for integration on operating system level (GNU Guix and GuixSD) through our buildsystem. The error itself is not caused by the build system.
@ng-0 Fair point. I will keep a couple of months as open window. Reopening the issue for now.
Many thanks, it's highly appreciated.
I'll try to address this before the end of this year, this should give me enough time and a set date for myself to work on this.