Skip to content

testing/py3-connexion: upgrade to 3.0.0

Steven Guikal requested to merge fluix/aports:py3-connexion into master
Would appreciate some help in fixing this test failure:
_____________________________________________ test_lifespan ______________________________________________
[gw3] linux -- Python 3.11.6 /home/build/aports/testing/py3-connexion/src/connexion-3.0.0/.testenv/bin/python3

fullname = '/home/build/aports/testing/py3-connexion/src/connexion-3.0.0'

    def find_loader(fullname):
        """Find a "loader" object for fullname
    
        This is a backwards compatibility wrapper around
        importlib.util.find_spec that converts most failures to ImportError
        and only returns the loader rather than the full spec
        """
        if fullname.startswith('.'):
            msg = "Relative module name {!r} not supported".format(fullname)
            raise ImportError(msg)
        try:
>           spec = importlib.util.find_spec(fullname)
E           ModuleNotFoundError: No module named '/home/build/aports/testing/py3-connexion/src/connexion-3'

/usr/lib/python3.11/pkgutil.py:496: ModuleNotFoundError

The above exception was the direct cause of the following exception:

    @pytest.mark.skipif(
        sys.version_info < (3, 8), reason="AsyncMock only available from 3.8."
    )
    async def test_lifespan():
        """Test that lifespan events are passed through if no handler is registered."""
        lifecycle_handler = mock.Mock()
    
        async def check_lifecycle(scope, receive, send):
            if scope["type"] == "lifespan":
                lifecycle_handler.handle()
    
>       test_app = ConnexionMiddleware(check_lifecycle)

tests/test_lifespan.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
connexion/middleware/main.py:231: in __init__
    self.root_path = utils.get_root_path(import_name)
connexion/utils.py:409: in get_root_path
    loader = pkgutil.get_loader(import_name)
/usr/lib/python3.11/pkgutil.py:482: in get_loader
    return find_loader(fullname)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

fullname = '/home/build/aports/testing/py3-connexion/src/connexion-3.0.0'

    def find_loader(fullname):
        """Find a "loader" object for fullname
    
        This is a backwards compatibility wrapper around
        importlib.util.find_spec that converts most failures to ImportError
        and only returns the loader rather than the full spec
        """
        if fullname.startswith('.'):
            msg = "Relative module name {!r} not supported".format(fullname)
            raise ImportError(msg)
        try:
            spec = importlib.util.find_spec(fullname)
        except (ImportError, AttributeError, TypeError, ValueError) as ex:
            # This hack fixes an impedance mismatch between pkgutil and
            # importlib, where the latter raises other errors for cases where
            # pkgutil previously raised ImportError
            msg = "Error while finding loader for {!r} ({}: {})"
>           raise ImportError(msg.format(fullname, type(ex), ex)) from ex
E           ImportError: Error while finding loader for '/home/build/aports/testing/py3-connexion/src/connexion-3.0.0' (<class 'ModuleNotFoundError'>: No module named '/home/build/aports/testing/py3-connexion/src/connexion-3')

/usr/lib/python3.11/pkgutil.py:502: ImportError
============================================ warnings summary ============================================
tests/api/test_responses.py: 8 warnings
tests/api/test_bootstrap.py: 4 warnings
  /usr/lib/python3.11/site-packages/starlette/templating.py:174: DeprecationWarning: The `name` is not the first parameter anymore. The first parameter should be the `Request` instance.
  Replace `TemplateResponse(name, {"request": request})` by `TemplateResponse(request, name)`.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================== short test summary info =========================================
FAILED tests/test_lifespan.py::test_lifespan - ImportError: Error while finding loader for '/home/build/aports/testing/py3-connexion/src/connexion-3...
============================== 1 failed, 763 passed, 12 warnings in 24.24s ===============================
Edited by Steven Guikal

Merge request reports