kmadathil / sanskrit_parser

Parsers for Sanskrit / संस्कृतम्
MIT License
69 stars 21 forks source link

pytest broken. #174

Closed vvasuki closed 2 years ago

vvasuki commented 2 years ago

While fixing sanscript usage via https://github.com/kmadathil/sanskrit_parser/commit/820d998d9cf4ec07d0511187928f0d00bead37c9 , I noticed that pytest could not be run. I get the below:

Launching pytest with arguments /home/vvasuki/sanskrit-coders/sanskrit_parser --no-header --no-summary -q in /home/vvasuki/sanskrit-coders/sanskrit_parser

Warning! Found 6,601 executable files in the PATH directories!
============================= test session starts ==============================
collecting ... 
tests/SandhiKosh/manual_test.py:None (tests/SandhiKosh/manual_test.py)
tests/SandhiKosh/manual_test.py:68: in <module>
    entries = get_kosh_entries()
tests/SandhiKosh/manual_test.py:19: in get_kosh_entries
    aa_kosh = pd.read_excel(os.path.join(data_dir, "Astaadhyaayii Corpus.xls"))[['S. No.', 'Word', 'Split']]
/usr/lib/python3.10/site-packages/pandas/util/_decorators.py:311: in wrapper
    return func(*args, **kwargs)
/usr/lib/python3.10/site-packages/pandas/io/excel/_base.py:364: in read_excel
    io = ExcelFile(io, storage_options=storage_options, engine=engine)
/usr/lib/python3.10/site-packages/pandas/io/excel/_base.py:1191: in __init__
    ext = inspect_excel_format(
/usr/lib/python3.10/site-packages/pandas/io/excel/_base.py:1070: in inspect_excel_format
    with get_handle(
/usr/lib/python3.10/site-packages/pandas/io/common.py:711: in get_handle
    handle = open(handle, ioargs.mode)
E   FileNotFoundError: [Errno 2] No such file or directory: '/home/vvasuki/sanskrit-coders/sanskrit_parser/tests/SandhiKosh/SandhiKosh/Astaadhyaayii Corpus.xls'

collected 133556 items / 1 error

Tried running pip install again and looked at the README, but could not figure out a script to get this missing file.

kmadathil commented 2 years ago

That's fine, only the tests under the test directory need be run. The subdirs have other requirements. In this case, it expects the SandhiKosh project data to be in a subdir. I have made it a submodule, but that has its own complications. You need to explicitly update them.

I'll leave this open until I confirm by running tests on the new master that all the requisite tests are passing.

I also notice that TravisCI isn't functional.

kmadathil commented 2 years ago

I am seeing test failures due to this change @vvasuki .
Please check with pytest --test-count 1000 tests/test_DhatuWrapper.py tests/test_sandhi.py tests/test_SanskritLexicalAnalyzer.py tests/test_SandhiKosh.py tests/test_parser.py

vvasuki commented 2 years ago

Fixed I think - https://github.com/kmadathil/sanskrit_parser/runs/6519127121?check_suite_focus=true should confirm .

kmadathil commented 2 years ago

Closing