Skip to content

Tests for 4.0.0 failing on openSUSE Tumbleweed: '' #592

@kastl-ars

Description

@kastl-ars

Dear maintainers,

I just tried to update the openSUSE package for gql to 4.0.0 and found that some tests were failing in our build environment.

All of them seem to fail with the same error:

[   55s]         if cafile or capath or cadata:
[   55s] >           context.load_verify_locations(cafile, capath, cadata)
[   55s] E           FileNotFoundError: [Errno 2] No such file or directory
[   55s] 
[   55s] /usr/lib64/python3.11/ssl.py:770: FileNotFoundError

The list of failing tests is:

[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_query - FileNotFound...
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_sync_batch_query - FileNotFoundE...
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_query_without_session
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_error_code - FileNot...
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[{}]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[qlsjfqsdlkj]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[{"not_data_or_errors": 35}]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[[{}]]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[[qlsjfqsdlkj]]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[[{"not_data_or_errors": 35}]]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[[]]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_invalid_protocol[[1]]
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_extra_args - FileNot...
[   55s] FAILED tests/test_httpx_batch.py::test_httpx_async_batch_query_with_extensions

Any idea which file(s) is/are not being found here?

Kind Regards,
Johannes

P.S.: A full trace would look like this:

[   56s] _________________ test_httpx_async_batch_query_with_extensions _________________
[   56s]                                     
[   56s] aiohttp_server = <function aiohttp_server_base.<locals>.go at 0x7ff2e974a980>
[   56s]                                                                                                                      
[   56s]     @pytest.mark.aiohttp                                                                                             
[   56s]     @pytest.mark.asyncio
[   56s]     async def test_httpx_async_batch_query_with_extensions(aiohttp_server):
[   56s]         from aiohttp import web                                                                                      
[   56s]                                                      
[   56s]         from gql.transport.httpx import HTTPXAsyncTransport
[   56s]                                          
[   56s]         async def handler(request):         
[   56s]             return web.Response(                     
[   56s]                 text=query1_server_answer_with_extensions_list,
[   56s]                 content_type="application/json",
[   56s]             )
[   56s]                                       
[   56s]         app = web.Application()                                                                                      
[   56s]         app.router.add_route("POST", "/", handler)                                                                   
[   56s]         server = await aiohttp_server(app)
[   56s]                                                    
[   56s]         url = str(server.make_url("/"))                                                                              
[   56s]                     
[   56s]         transport = HTTPXAsyncTransport(url=url)                                                                     
[   56s]                                                                                                                      
[   56s]         query = [GraphQLRequest(query1_str)]                                                                         
[   56s]                      
[   56s] >       async with Client(transport=transport) as session:                                                                                                                                                                                          [   56s]                                       
[   56s] tests/test_httpx_batch.py:369:                   
[   56s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   56s] gql/client.py:803: in __aenter__                                                                                     
[   56s]     return await self.connect_async()                                                                                
[   56s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                
[   56s] gql/client.py:782: in connect_async                                                                                  
[   56s]     await self.session.connect()                                                                                     
[   56s] gql/client.py:1851: in connect                                                                                       
[   56s]     raise e                                                                                                          
[   56s] gql/client.py:1848: in connect                                                                                       
[   56s]     await self.transport.connect()                                                                                   
[   56s] gql/transport/httpx.py:329: in connect                                                                               
[   56s]     self.client = httpx.AsyncClient(**self.kwargs)                                                                   
[   56s]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                   
[   56s] /usr/lib/python3.11/site-packages/httpx/_client.py:1402: in __init__         
[   56s]     self._transport = self._init_transport(                                                                          
[   56s] /usr/lib/python3.11/site-packages/httpx/_client.py:1445: in _init_transport     
[   56s]     return AsyncHTTPTransport(                                                                                       
[   56s] /usr/lib/python3.11/site-packages/httpx/_transports/default.py:297: in __init__ 
[   56s]     ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)
[   56s]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   56s] /usr/lib/python3.11/site-packages/httpx/_config.py:40: in create_ssl_context
[   56s]     ctx = ssl.create_default_context(cafile=certifi.where())
[   56s]           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   56s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _     
[   56s] 
[   56s] purpose = <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')>
[   56s]                     
[   56s]     def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
[   56s]                                capath=None, cadata=None):
[   56s]         """Create a SSLContext object with default settings.                                 
[   56s]                                            
[   56s]         NOTE: The protocol and settings may change anytime without prior
[   56s]               deprecation. The values represent a fair balance between maximum
[   56s]               compatibility and security.
[   56s]         """
[   56s]         if not isinstance(purpose, _ASN1Object):
[   56s]             raise TypeError(purpose)
[   56s]     
[   56s]         # SSLContext sets OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION,
[   56s]         # OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE and OP_SINGLE_ECDH_USE
[   56s]         # by default.
[   56s]         if purpose == Purpose.SERVER_AUTH:
[   56s]             # verify certs and host name in client mode
[   56s]             context = SSLContext(PROTOCOL_TLS_CLIENT)
[   56s]             context.verify_mode = CERT_REQUIRED
[   56s]             context.check_hostname = True
[   56s]         elif purpose == Purpose.CLIENT_AUTH:
[   56s]             context = SSLContext(PROTOCOL_TLS_SERVER)
[   56s]         else:
[   56s]             raise ValueError(purpose)
[   56s]     
[   56s]         if cafile or capath or cadata:
[   56s] >           context.load_verify_locations(cafile, capath, cadata)
[   56s] E           FileNotFoundError: [Errno 2] No such file or directory
[   56s] 
[   56s] /usr/lib64/python3.11/ssl.py:770: FileNotFoundError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions