-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.1: pytest fails in lupa/tests/test.py::TestOverflowMixin::test_no_overflow
unit
#266
Comments
Looks like with pytest 8.2.1 test suite is no0t able to pass collecting units + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-lupa-2.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-lupa-2.1-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network' lupa/tests/__init__.py lupa/tests/test.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/lupa-lupa-2.1
configfile: pyproject.toml
plugins: flakes-4.0.5
collected 0 items / 1 error
========================================================================================== ERRORS ===========================================================================================
____________________________________________________________________________ ERROR collecting lupa/tests/test.py ____________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/lupa-lupa-2.1/lupa/tests/test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
lupa/tests/test.py:2318: in <module>
@lupa.unpacks_lua_table
lupa/__init__.py:88: in __getattr__
lua = _newest_lib if _newest_lib is not None else _import_newest_lib()
lupa/__init__.py:65: in _import_newest_lib
_newest_lib = __import__(module_name[0], level=1, fromlist="*", globals=globals())
E ModuleNotFoundError: No module named 'lupa.lua'
================================================================================== short test summary info ==================================================================================
ERROR lupa/tests/test.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 1 error in 0.24s ====================================================================================== |
Just FTR .. tested 2.2 and pytest still fails the same way. |
I don't use pytest myself. Try |
Correctly written unittest based test suite is correctly handled by pytest. |
I can't find anything particularly strange about it, but the test suite is generated, or rather duplicated, for each Lua version module. Maybe that explains why it's not just a trivial import. |
|
That line imports the Lua module with the latest available version, after putting some effort into selecting it. It's a bit more than a simple import since it needs to work regardless of the number and versions of available Lua modules. |
So why this import fails? 🤔 |
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesinstaller
modulecut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
List of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.
The text was updated successfully, but these errors were encountered: