You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pytest test_text_analysis.py
==================================================================================== test session starts ====================================================================================
platform freebsd14 -- Python 3.11.9, pytest-8.1.1, pluggy-1.5.0
rootdir: /usr/ports/textproc/py-gensim/work-py311/gensim-4.3.3
configfile: pyproject.toml
plugins: hypothesis-6.98.18, time-machine-2.11.0, flaky-3.8.1, xdist-3.6.1, timeout-2.1.0, rerunfailures-11.1.2, cov-5.0.0, aspectlib-2.0.0, subprocess-1.5.2, anyio-4.4.0, respx-0.21.1, pytest_httpserver-1.0.12, asyncio-0.23.8
asyncio: mode=Mode.STRICT
collected 0 items / 1 error
========================================================================================== ERRORS ===========================================================================================
____________________________________________________________________ ERROR collecting gensim/test/test_text_analysis.py _____________________________________________________________________
../matutils.py:1356: in <module>
from gensim.corpora._mmreader import MmReader # noqa: F401
E ModuleNotFoundError: No module named 'gensim.corpora._mmreader'
During handling of the above exception, another exception occurred:
/usr/local/lib/python3.11/site-packages/pytest_asyncio/plugin.py:644: in _patched_collect
module = collector.obj
/usr/local/lib/python3.11/site-packages/_pytest/python.py:315: in obj
self._obj = obj = self._getobj()
/usr/local/lib/python3.11/site-packages/_pytest/python.py:573: in _getobj
return importtestmodule(self.path, self.config)
/usr/local/lib/python3.11/site-packages/_pytest/python.py:520: in importtestmodule
mod = import_path(
/usr/local/lib/python3.11/site-packages/_pytest/pathlib.py:584: in import_path
importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1204: in _gcd_import
???
<frozen importlib._bootstrap>:1176: in _find_and_load
???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1204: in _gcd_import
???
<frozen importlib._bootstrap>:1176: in _find_and_load
???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
<frozen importlib._bootstrap>:1204: in _gcd_import
???
<frozen importlib._bootstrap>:1176: in _find_and_load
???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:690: in _load_unlocked
???
<frozen importlib._bootstrap_external>:940: in exec_module
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
../__init__.py:11: in <module>
from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils # noqa:F401
../corpora/__init__.py:6: in <module>
from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes
../corpora/indexedcorpus.py:14: in <module>
from gensim import interfaces, utils
../interfaces.py:19: in <module>
from gensim import utils, matutils
../matutils.py:1359: in <module>
raise utils.NO_CYTHON
E RuntimeError: Compiled extensions are unavailable. If you've installed from a package, ask the package maintainer to include compiled extensions. If you're building Gensim from source yourself, install Cython and a C compiler, and then run `python setup.py build_ext --inplace` to retry.
-------------------------------------------------------------------------------------- Captured stdout --------------------------------------------------------------------------------------
gensim/matutils.py: exc=No module named 'gensim.corpora._mmreader'
================================================================================== short test summary info ==================================================================================
ERROR test_text_analysis.py - RuntimeError: Compiled extensions are unavailable. If you've installed from a package, ask the package maintainer to include compiled extensions. If you're building Gensim from source ...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 1 error in 4.56s ======================================================================================
The error is caused by this import statement: from gensim.corpora._mmreader import MmReader
However, this import succeeds when done from the Python interpreter.
It only fails under PyTest.
This tests succeeds when run from Python:
$ python3.11 test_text_analysis.py
............
----------------------------------------------------------------------
Ran 12 tests in 0.309s
OK
Steps/code/corpus to reproduce
gensim is built and installed in a standard way, like all other python packages.
It seems to function fine. Each test passes when run separately from the python interpreter.
Problem description
PyTest fails to run tests. For example:
The error is caused by this import statement:
from gensim.corpora._mmreader import MmReader
However, this import succeeds when done from the Python interpreter.
It only fails under PyTest.
This tests succeeds when run from Python:
Steps/code/corpus to reproduce
gensim is built and installed in a standard way, like all other python packages.
It seems to function fine. Each test passes when run separately from the python interpreter.
Test infrastructure itself seems to be broken.
Versions
The text was updated successfully, but these errors were encountered: