Giter VIP home page Giter VIP logo

Comments (8)

kloczek avatar kloczek commented on August 20, 2024

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 ======================================================================================

from lupa.

kloczek avatar kloczek commented on August 20, 2024

Just FTR .. tested 2.2 and pytest still fails the same way.

from lupa.

scoder avatar scoder commented on August 20, 2024

I don't use pytest myself. Try python -m unittest -v lupa.tests.suite.

from lupa.

kloczek avatar kloczek commented on August 20, 2024

Correctly written unittest based test suite is correctly handled by pytest.
What is the propose of importing module in such strange way? 🤔

from lupa.

scoder avatar scoder commented on August 20, 2024

What is the propose of importing module in such strange way? 🤔

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.

from lupa.

kloczek avatar kloczek commented on August 20, 2024

_newest_lib = __import__(module_name[0], level=1, fromlist="*", globals=globals())

from lupa.

scoder avatar scoder commented on August 20, 2024

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.

from lupa.

kloczek avatar kloczek commented on August 20, 2024

So why this import fails? 🤔

from lupa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.