aio-libs / aiohttp

Asynchronous HTTP client/server framework for asyncio and Python
https://docs.aiohttp.org
Other
15.14k stars 2.02k forks source link

3.8.4: pytest is failing in 9 units #7255

Closed kloczek closed 6 months ago

kloczek commented 1 year ago

Describe the bug

pytest is failing in 9 units.

To Reproduce

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.

Expected behavior

Pytest should not fail.

Logs/tracebacks

In next comment.

Python Version

3.8.16

aiohttp Version

3.8.4

multidict Version

6.0.4

yarl Version

1.8.2

OS

Linux x86/64

Related component

Server

Additional context

Here is list of installed modules in build env

```console Package Version ------------------ ---------- aiosignal 1.3.1 async-generator 1.10 async-timeout 4.0.2 attrs 22.2.0 Brotli 1.0.9 build 0.10.0 charset-normalizer 3.1.0 coverage 7.2.3 Cython 0.29.33 distro 1.8.0 exceptiongroup 1.0.0 freezegun 1.2.1 frozenlist 1.3.3 gpg 1.19.0 idna 3.4 iniconfig 2.0.0 installer 0.7.0 libcomps 0.1.19 multidict 6.0.4 packaging 23.0 pluggy 1.0.0 pyproject_hooks 1.0.0 pytest 7.3.1 pytest-cov 4.0.0 pytest-mock 3.10.0 python-dateutil 2.8.2 re-assert 1.1.0 regex 2022.10.31 setuptools 67.6.1 six 1.16.0 tomli 2.0.1 wheel 0.40.0 yarl 1.8.2 ```

Code of Conduct

kloczek commented 1 year ago

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' -q -p no:randomly --ignore tests/test_proxy_functional.py ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.8.4 configfile: setup.cfg testpaths: tests/ plugins: cov-4.0.0, mock-3.10.0 collected 2567 items / 2 skipped tests/test___all__.py .. [ 0%] tests/test_base_protocol.py .............. [ 0%] tests/test_circular_imports.py FFFF............ .q..............................F [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 4%] tests/test_client_fingerprint.py ............ [ 4%] tests/test_client_functional.py ...............xxx....................................................................................x...................xxx.......x.............x.. [ 10%] ........ [ 10%] tests/test_client_proto.py ........... [ 11%] tests/test_client_request.py .....................................................................................................................x.... [ 15%] tests/test_client_response.py ........................................................ [ 17%] tests/test_client_session.py ..........................................s...FF...... [ 20%] tests/test_client_ws.py ........................... [ 21%] tests/test_client_ws_functional.py ............................... [ 22%] tests/test_connector.py ....x..................................................................................................sss..xx..s........... [ 27%] tests/test_cookiejar.py ............................................ [ 28%] tests/test_flowcontrol_streams.py ............. [ 29%] tests/test_formdata.py .......... [ 29%] tests/test_helpers.py ................................................................................................... [ 33%] tests/test_http_exceptions.py ................... [ 34%] tests/test_http_parser.py ........................................................................................................................................................... [ 40%] ................................ [ 41%] tests/test_http_writer.py ..................... [ 42%] tests/test_locks.py ... [ 42%] tests/test_loop.py ..... [ 42%] tests/test_multipart.py ........................................................................................................ [ 46%] tests/test_multipart_helpers.py ...............s.................................................ss......ss............................ [ 50%] tests/test_payload.py .............. [ 51%] tests/test_proxy.py .......s........ [ 52%] tests/test_pytest_plugin.py .... [ 52%] tests/test_resolver.py ssssssss.....s.sss.. [ 52%] tests/test_route_def.py ...................... [ 53%] tests/test_run_app.py ............................................... [ 55%] tests/test_streams.py ....................................................................................................... [ 59%] tests/test_tcp_helpers.py ...... [ 59%] tests/test_test_utils.py ................................................ [ 61%] tests/test_tracing.py ................... [ 62%] tests/test_urldispatch.py ............................................................................................................................................ [ 67%] tests/test_web_app.py .......................s........... [ 69%] tests/test_web_cli.py .......... [ 69%] tests/test_web_exceptions.py ................. [ 70%] tests/test_web_functional.py ...........................x................................................................................... [ 74%] tests/test_web_log.py ......... [ 75%] tests/test_web_middleware.py ................................................................................................................... [ 79%] tests/test_web_request.py ...........................................................................s............................ [ 83%] tests/test_web_request_handler.py .... [ 83%] tests/test_web_response.py ................................................................................................................................... [ 88%] tests/test_web_runner.py ..........ss.. [ 89%] tests/test_web_sendfile.py ..... [ 89%] tests/test_web_sendfile_functional.py ................................................x..................................... [ 92%] tests/test_web_server.py .x....... [ 93%] tests/test_web_urldispatcher.py ...........................xxx [ 94%] tests/test_web_websocket.py ............................................ [ 96%] tests/test_web_websocket_functional.py ......................... [ 97%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py .......................................... [ 99%] tests/test_websocket_writer.py ........FF. [100%] ========================================================================================= FAILURES ========================================================================================== ____________________________________________________________________________ test_no_warnings[aiohttp._helpers] _____________________________________________________________________________ import_path = 'aiohttp._helpers' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._helpers' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._helpers')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._helpers' __________________________________________________________________________ test_no_warnings[aiohttp._http_parser] ___________________________________________________________________________ import_path = 'aiohttp._http_parser' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_parser' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._http_parser')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_parser' __________________________________________________________________________ test_no_warnings[aiohttp._http_writer] ___________________________________________________________________________ import_path = 'aiohttp._http_writer' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_writer' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._http_writer')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_writer' ___________________________________________________________________________ test_no_warnings[aiohttp._websocket] ____________________________________________________________________________ import_path = 'aiohttp._websocket' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._websocket' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._websocket')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._websocket' _____________________________________________________________________________ test_no_warnings[aiohttp.worker] ______________________________________________________________________________ import_path = 'aiohttp.worker' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp.worker' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp.worker')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in File "/home/tkloczko/rpmbuild/BUILD/aiohttp-3.8.4/aiohttp/worker.py", line 11, in from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat ModuleNotFoundError: No module named 'gunicorn' _____________________________________________________________________________ test_client_session_timeout_zero ______________________________________________________________________________ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await asyncio.shield(host_resolved) client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , host = 'example.com', port = 80, traces = [] async def _resolve_host( self, host: str, port: int, traces: Optional[List["Trace"]] = None ) -> List[Dict[str, Any]]: if is_ip_address(host): return [ { "hostname": host, "host": host, "port": port, "family": self._family, "proto": 0, "flags": 0, } ] if not self._use_dns_cache: if traces: for trace in traces: await trace.send_dns_resolvehost_start(host) res = await self._resolver.resolve(host, port, family=self._family) if traces: for trace in traces: await trace.send_dns_resolvehost_end(host) return res key = (host, port) if (key in self._cached_hosts) and (not self._cached_hosts.expired(key)): # get result early, before any await (#4014) result = self._cached_hosts.next_addrs(key) if traces: for trace in traces: await trace.send_dns_cache_hit(host) return result if key in self._throttle_dns_events: # get event early, before any await (#4014) event = self._throttle_dns_events[key] if traces: for trace in traces: await trace.send_dns_cache_hit(host) await event.wait() else: # update dict early, before any await (#4014) self._throttle_dns_events[key] = EventResultOrError(self._loop) if traces: for trace in traces: await trace.send_dns_cache_miss(host) try: if traces: for trace in traces: await trace.send_dns_resolvehost_start(host) > addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:874: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , hostname = 'example.com', port = 80, family = 0 async def resolve( self, hostname: str, port: int = 0, family: int = socket.AF_INET ) -> List[Dict[str, Any]]: > infos = await self._loop.getaddrinfo( hostname, port, type=socket.SOCK_STREAM, family=family, flags=socket.AI_ADDRCONFIG, ) family = 0 hostname = 'example.com' port = 80 self = ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/resolver.py:33: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, host = 'example.com', port = 80 async def getaddrinfo(self, host, port, *, family=0, type=0, proto=0, flags=0): if self._debug: getaddr_func = self._getaddrinfo_debug else: getaddr_func = socket.getaddrinfo > return await self.run_in_executor( None, getaddr_func, host, port, family, type, proto, flags) family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.8/asyncio/base_events.py:825: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = None def run(self): if not self.future.set_running_or_notify_cancel(): return try: > result = self.fn(*self.args, **self.kwargs) self = None /usr/lib64/python3.8/concurrent/futures/thread.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = , proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.8/socket.py:918: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) tests/test_client_session.py:846: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/client.py:536: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_redirects = 10 method = 'GET' params = None proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) redirects = 0 req = self = skip_auto_headers = None skip_headers = set() ssl = None ssl_context = None str_or_url = 'http://example.com' timeout = timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:540: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:901: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1166: ClientConnectorError _____________________________________________________________________________ test_requote_redirect_url_default _____________________________________________________________________________ cls = , func = . at 0x7f5251a89f70>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.035909425001591444 excinfo = \n') tblen=6> func = . at 0x7f5251a89f70> precise_start = 635040.454537234 precise_stop = 635040.490446659 reraise = (, ) result = None start = 1681724830.4682982 stop = 1681724830.5042088 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = <_HookCaller 'pytest_runtest_call'> item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265: in __call__ return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) argname = 'item' args = () firstresult = False kwargs = {'item': } self = <_HookCaller 'pytest_runtest_call'> /usr/lib/python3.8/site-packages/pluggy/_manager.py:80: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f5255961580> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 568, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f525174b3d0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning __________________________________________________________________________________ test_send_compress_text __________________________________________________________________________________ __wrapped_mock_method__ = , args = (, b'\xc1\x05*\x01b\x00\x00'), kwargs = {} __tracebackhide__ = True msg = "expected call not found.\nExpected: write(b'\\xc1\\x05*\\x01b\\x00\\x00')\nActual: write(b'\\xc1\\x04\\x02a\\x00\\x00...\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" __mock_self = , actual_args = (b'\xc1\x04\x02a\x00\x00',), actual_kwargs = {} introspection = "\nArgs:\nassert (b'\\xc1\\x04\\x02a\\x00\\x00',) == (b'\\xc1\\x05*\\x01b\\x00\\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" @py_assert2 = (b'\xc1\x05*\x01b\x00\x00',), @py_assert1 = None @py_format4 = "(b'\\xc1\\x04\\x02a\\x00\\x00',) == (b'\\xc1\\x05*\\x01b\\x00\\x00',)\n~At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n~Use -v to get more diff" def assert_wrapper( __wrapped_mock_method__: Callable[..., Any], *args: Any, **kwargs: Any ) -> None: __tracebackhide__ = True try: > __wrapped_mock_method__(*args, **kwargs) __mock_self = __tracebackhide__ = True __wrapped_mock_method__ = actual_args = (b'\xc1\x04\x02a\x00\x00',) actual_kwargs = {} args = (, b'\xc1\x05*\x01b\x00\x00') introspection = "\nArgs:\nassert (b'\\xc1\\x04\\x02a\\x00\\x00',) == (b'\\xc1\\x05*\\x01b\\x00\\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" kwargs = {} msg = "expected call not found.\nExpected: write(b'\\xc1\\x05*\\x01b\\x00\\x00')\nActual: write(b'\\xc1\\x04\\x02a\\x00\\x00...\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" /usr/lib/python3.8/site-packages/pytest_mock/plugin.py:444: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {}, expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) actual = call(b'\xc1\x04\x02a\x00\x00'), _error_message = ._error_message at 0x7f5250b2e1f0>, cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher((args, kwargs)) actual = self._call_matcher(self.call_args) if expected != actual: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7f5250b2e1f0> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) kwargs = {} self = /usr/lib64/python3.8/unittest/mock.py:913: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:88: AssertionError ____________________________________________________________________________ test_send_compress_text_notakeover _____________________________________________________________________________ cls = , func = . at 0x7f5250964280>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.04634519002866 excinfo = \n') tblen=6> func = . at 0x7f5250964280> precise_start = 635132.336947755 precise_stop = 635132.383292945 reraise = (, ) result = None start = 1681724922.3507087 stop = 1681724922.3970554 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = <_HookCaller 'pytest_runtest_call'> item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265: in __call__ return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) argname = 'item' args = () firstresult = False kwargs = {'item': } self = <_HookCaller 'pytest_runtest_call'> /usr/lib/python3.8/site-packages/pluggy/_manager.py:80: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f5255961580> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 568, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f52515c1ca0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ---------- coverage: platform linux, python 3.8.16-final-0 ----------- Name Stmts Miss Branch BrPart Cover -------------------------------------------------------------------------- aiohttp/__init__.py 18 1 0 0 94% aiohttp/abc.py 90 6 0 0 93% aiohttp/base_protocol.py 66 51 22 0 17% aiohttp/client.py 475 355 168 1 19% aiohttp/client_exceptions.py 135 61 16 0 49% aiohttp/client_proto.py 146 118 54 0 14% aiohttp/client_reqrep.py 642 485 280 0 18% aiohttp/client_ws.py 206 166 64 0 15% aiohttp/connector.py 710 587 311 0 12% aiohttp/cookiejar.py 256 207 116 0 13% aiohttp/formdata.py 93 76 46 0 12% aiohttp/hdrs.py 94 1 2 1 98% aiohttp/helpers.py 456 284 160 3 30% aiohttp/http.py 11 0 0 0 100% aiohttp/http_exceptions.py 49 20 6 0 53% aiohttp/http_parser.py 482 397 180 1 13% aiohttp/http_websocket.py 379 283 152 0 19% aiohttp/http_writer.py 118 83 50 0 21% aiohttp/locks.py 24 16 4 0 29% aiohttp/log.py 7 0 0 0 100% aiohttp/multipart.py 560 454 234 0 14% aiohttp/payload.py 221 109 58 1 42% aiohttp/payload_streamer.py 29 10 4 0 70% aiohttp/pytest_plugin.py 168 125 44 0 20% aiohttp/resolver.py 68 48 22 0 22% aiohttp/streams.py 393 310 144 0 15% aiohttp/tcp_helpers.py 19 11 6 0 32% aiohttp/test_utils.py 336 229 60 1 27% aiohttp/tracing.py 191 69 32 0 69% aiohttp/typedefs.py 26 1 2 1 93% aiohttp/web.py 117 46 54 11 54% aiohttp/web_app.py 274 117 72 16 51% aiohttp/web_exceptions.py 151 22 6 0 82% aiohttp/web_fileresponse.py 144 120 52 0 12% aiohttp/web_log.py 98 55 18 0 37% aiohttp/web_middlewares.py 56 37 20 0 25% aiohttp/web_protocol.py 335 275 155 0 13% aiohttp/web_request.py 430 282 126 1 28% aiohttp/web_response.py 485 371 212 1 16% aiohttp/web_routedef.py 106 46 10 0 55% aiohttp/web_runner.py 209 98 34 4 47% aiohttp/web_server.py 33 9 4 0 65% aiohttp/web_urldispatcher.py 708 446 163 1 30% aiohttp/web_ws.py 316 254 106 0 15% aiohttp/worker.py 129 121 32 0 5% tests/autobahn/test_autobahn.py 60 52 10 0 11% tests/conftest.py 104 35 18 6 63% tests/test___all__.py 9 0 0 0 100% tests/test_base_protocol.py 152 0 2 0 100% tests/test_circular_imports.py 31 1 15 1 96% tests/test_classbasedview.py 39 2 0 0 95% tests/test_client_connection.py 94 0 2 1 99% tests/test_client_exceptions.py 188 2 18 2 98% tests/test_client_fingerprint.py 59 0 0 0 100% tests/test_client_functional.py 2060 119 68 7 94% tests/test_client_proto.py 94 0 0 0 100% tests/test_client_request.py 751 6 18 0 99% tests/test_client_response.py 469 3 2 1 99% tests/test_client_session.py 496 16 27 2 97% tests/test_client_ws.py 415 0 2 0 100% tests/test_client_ws_functional.py 585 11 14 3 98% tests/test_connector.py 1494 94 66 11 93% tests/test_cookiejar.py 325 0 22 3 99% tests/test_flowcontrol_streams.py 100 0 0 0 100% tests/test_formdata.py 72 0 6 0 100% tests/test_helpers.py 370 7 14 3 97% tests/test_http_exceptions.py 107 0 10 0 100% tests/test_http_parser.py 760 7 36 0 99% tests/test_http_writer.py 182 0 10 0 100% tests/test_locks.py 39 1 0 0 97% tests/test_loop.py 39 2 0 0 95% tests/test_multipart.py 747 4 26 3 99% tests/test_multipart_helpers.py 446 19 0 0 96% tests/test_payload.py 94 5 0 0 95% tests/test_proxy.py 264 18 0 0 93% tests/test_proxy_functional.py 487 487 22 0 0% tests/test_pytest_plugin.py 30 0 0 0 100% tests/test_resolver.py 176 81 12 0 54% tests/test_route_def.py 210 20 0 0 90% tests/test_run_app.py 337 7 24 8 96% tests/test_streams.py 1063 1 40 1 99% tests/test_tcp_helpers.py 52 2 2 1 94% tests/test_test_utils.py 242 5 6 2 97% tests/test_tracing.py 48 0 0 0 100% tests/test_urldispatch.py 844 12 24 1 99% tests/test_web_app.py 420 6 6 0 99% tests/test_web_cli.py 75 0 0 0 100% tests/test_web_exceptions.py 156 0 22 0 100% tests/test_web_functional.py 1514 29 34 4 98% tests/test_web_log.py 110 2 0 0 98% tests/test_web_middleware.py 266 3 12 2 98% tests/test_web_request.py 492 3 8 0 99% tests/test_web_request_handler.py 40 1 0 0 98% tests/test_web_response.py 818 3 4 1 99% tests/test_web_runner.py 128 9 4 0 93% tests/test_web_sendfile.py 84 0 0 0 100% tests/test_web_sendfile_functional.py 634 21 18 0 96% tests/test_web_server.py 110 3 0 0 97% tests/test_web_urldispatcher.py 307 7 16 2 97% tests/test_web_websocket.py 304 2 4 0 99% tests/test_web_websocket_functional.py 542 42 16 4 92% tests/test_websocket_handshake.py 152 0 12 0 100% tests/test_websocket_parser.py 300 9 12 1 97% tests/test_websocket_writer.py 68 0 0 0 100% tests/test_worker.py 197 189 4 0 4% -------------------------------------------------------------------------- TOTAL 30910 8210 3989 113 67% =================================================================================== slowest 10 durations ==================================================================================== 10.99s teardown tests/test_web_functional.py::test_100_continue_for_not_found[pyloop] 10.22s teardown tests/test_web_functional.py::test_post_max_client_size[pyloop] 10.15s teardown tests/test_web_functional.py::test_100_continue_custom_response[pyloop] 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.01s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.01s call tests/test_client_functional.py::test_readline_error_on_conn_close[pyloop] 1.00s call tests/test_client_functional.py::test_timeout_on_reading_data[pyloop] 0.98s call tests/test_payload.py::test_stream_reader_long_lines 0.55s call tests/test_circular_imports.py::test_no_warnings[aiohttp.pytest_plugin] 0.53s call tests/test_base_protocol.py::test_parallel_drain_race_condition ================================================================================== short test summary info ================================================================================== SKIPPED [1] tests/test_worker.py:12: could not import 'aiohttp.worker': No module named 'gunicorn' SKIPPED [1] tests/autobahn/test_autobahn.py:10: 'python-on-whales' requires Python 3.7+ SKIPPED [1] tests/test_client_session.py:800: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1937: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1945: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1956: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2106: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_proxy.py:359: The tested code path is only reachable below Python 3.7 because those versions don't yet have `asyncio.loop.start_tls()` implemeneted SKIPPED [1] tests/test_resolver.py:48: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:58: aiodns required SKIPPED [1] tests/test_resolver.py:69: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:80: aiodns required SKIPPED [1] tests/test_resolver.py:91: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:100: aiodns required SKIPPED [1] tests/test_resolver.py:110: aiodns required SKIPPED [1] tests/test_resolver.py:120: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:212: aiodns required SKIPPED [1] tests/test_resolver.py:224: aiodns required SKIPPED [1] tests/test_resolver.py:231: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:241: aiodns required SKIPPED [1] tests/test_web_app.py:318: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_request.py:693: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_ssl_client[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_ok[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_fail[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-entirely different hosts] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-http -> https] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-https -> http] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_aiohttp_request_ctx_manager_close_sess_on_error[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_error_in_performing_request[pyloop] - reason: trustme is not supported XFAIL tests/test_client_request.py::test_verify_ssl_false_with_ssl_context[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_connector.py::test_tcp_connector_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_sendfile_functional.py::test_static_file_ssl[pyloop] - reason: trustme is not supported XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._helpers] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_parser] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_writer] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._websocket] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp.worker] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_client_session.py::test_client_session_timeout_zero - aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] FAILED tests/test_client_session.py::test_requote_redirect_url_default - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionError: expected call not found. FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - pytest.PytestUnraisableExceptionWarning: Exception ignored in: ============================================================ 9 failed, 2512 passed, 29 skipped, 19 xfailed in 142.88s (0:02:22) ============================================================= ```
Dreamsorcerer commented 1 year ago

The circular_imports tests appear to be failing to import. I'd compare with how our CI runs it (https://github.com/aio-libs/aiohttp/blob/master/.github/workflows/ci.yml#L128), but I suspect you'll need to install the package or tweak PYTHONPATH to get it to work correctly.

Then it looks like there is a DNS error, maybe that test should be mocked or something...

The unclosed socket warnings we do see occasionally, but haven't figured out how to fix yet. Not sure about the compress assertion..

kloczek commented 1 year ago

suspect you'll need to install the package or tweak PYTHONPATH to get it to work correctly.

Can you explain what exactly you mean? 🤔

Dreamsorcerer commented 1 year ago

It's running a subprocess, and that subprocess can't find aiohttp. It's a little bit awkward the way it needs to run another process, and I remember needing to fiddle a bit to get another test working that way.

kloczek commented 1 year ago

OK so what this descriprion has to do with $PYTHONPATH env variable? 🤔 Did you saw in ticket description that I've alredy heve been using that variable?

Dreamsorcerer commented 1 year ago

OK so what this descriprion has to do with $PYTHONPATH env variable?

Well, if it can't find it and you didn't install it, then you might need to add the source code directory to PYTHONPATH. Otherwise, maybe the code is not passing the variable through to the subprocess. Just some guesses as to why it's not finding aiohttp.

kloczek commented 1 year ago

Well, if it can't find it and you didn't install it, then you might need to add the source code directory to PYTHONPATH. Otherwise, maybe the code is not passing the variable through to the subprocess. Just some guesses as to why it's not finding aiohttp.

Please read one mote time description of what I've exacly done. I'm already using $PYTHONPATH .

Dreamsorcerer commented 1 year ago

I read it the first time, it didn't help help me understand if it's pointing in the right place or not. Maybe I'm just not familiar with what sitearch/sitelib means. Either way, back to my first point, please look at how the CI runs the tests, it passes successfully there.

kloczek commented 1 year ago

That procedure is now used on massive scale on packaging as rpm, deb and other types of package management software.

Maybe I'm just not familiar with what sitearch/sitelib means.

[tkloczko@pers-jacek SRPMS]$ python3 -Ic "import sysconfig; print(sysconfig.get_path('platlib'))"
/usr/lib64/python3.8/site-packages
[tkloczko@pers-jacek SRPMS]$ python3 -Ic "import sysconfig; print(sysconfig.get_path('purelib'))";
/usr/lib/python3.8/site-packages

This is why in first line of the build log which Ive copied is

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64/usr/lib/python3.8/site-packages

In this case /home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-5.fc35.x86_64 it is my </install/prefix>.

kloczek commented 1 year ago

It's running a subprocess, and that subprocess can't find aiohttp. It's a little bit awkward the way it needs to run another process, and I remember needing to fiddle a bit to get another test working that way.

I think that I know why it is. Currently pytest shows deprecation warnings about use pkg_resources module. This module is know that it messes with sys.path. Use of pkg_resources needs to be dropped.

kloczek commented 1 year ago

Just reteded aiohttp in updated build env and found that pytest is failing in new unit

```console ========================================================================================= FAILURES ========================================================================================== __________________________________________________________________________ test_request_tracing_url_params[pyloop] __________________________________________________________________________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False>, aiohttp_client = .go at 0x7fe1a30964c0> async def test_request_tracing_url_params(loop: Any, aiohttp_client: Any) -> None: async def root_handler(request): return web.Response() async def redirect_handler(request): raise web.HTTPFound("/") app = web.Application() app.router.add_get("/", root_handler) app.router.add_get("/redirect", redirect_handler) mocks = [mock.Mock(side_effect=make_mocked_coro(mock.Mock())) for _ in range(7)] ( on_request_start, on_request_redirect, on_request_end, on_request_exception, on_request_chunk_sent, on_response_chunk_received, on_request_headers_sent, ) = mocks trace_config = aiohttp.TraceConfig( trace_config_ctx_factory=mock.Mock(return_value=mock.Mock()) ) trace_config.on_request_start.append(on_request_start) trace_config.on_request_redirect.append(on_request_redirect) trace_config.on_request_end.append(on_request_end) trace_config.on_request_exception.append(on_request_exception) trace_config.on_request_chunk_sent.append(on_request_chunk_sent) trace_config.on_response_chunk_received.append(on_response_chunk_received) trace_config.on_request_headers_sent.append(on_request_headers_sent) session = await aiohttp_client(app, trace_configs=[trace_config]) def reset_mocks() -> None: for m in mocks: m.reset_mock() def to_trace_urls(mock_func: mock.Mock) -> List[URL]: return [call_args[0][-1].url for call_args in mock_func.call_args_list] def to_url(path: str) -> URL: return session.make_url(path) # Standard for req in [ lambda: session.get("/?x=0"), lambda: session.get("/", params=dict(x=0)), ]: reset_mocks() async with req() as resp: await resp.text() > assert to_trace_urls(on_request_start) == [to_url("/?x=0")] E AssertionError: assert [URL('http://....0.1:41091/')] == [URL('http://...:41091/?x=0')] E At index 0 diff: URL('http://127.0.0.1:41091/') != URL('http://127.0.0.1:41091/?x=0') E Use -v to get more diff aiohttp_client = .go at 0x7fe1a30964c0> app = loop = <_UnixSelectorEventLoop running=False closed=False debug=False> mocks = [, , , , , , ...] on_request_chunk_sent = on_request_end = on_request_exception = on_request_headers_sent = on_request_redirect = on_request_start = on_response_chunk_received = redirect_handler = .redirect_handler at 0x7fe1a1b5ec10> req = . at 0x7fe1a1b5ef70> reset_mocks = .reset_mocks at 0x7fe1a1b5edc0> resp = root_handler = .root_handler at 0x7fe1a35015e0> session = to_trace_urls = .to_trace_urls at 0x7fe1a1b5ee50> to_url = .to_url at 0x7fe1a1b5eee0> trace_config = tests/test_client_session.py:669: AssertionError ---------- coverage: platform linux, python 3.8.16-final-0 ----------- Name Stmts Miss Branch BrPart Cover -------------------------------------------------------------------------- aiohttp/__init__.py 18 1 0 0 94% aiohttp/abc.py 90 6 0 0 93% aiohttp/base_protocol.py 66 51 22 0 17% aiohttp/client.py 475 355 168 1 19% aiohttp/client_exceptions.py 135 61 16 0 49% aiohttp/client_proto.py 146 118 54 0 14% aiohttp/client_reqrep.py 642 485 280 0 18% aiohttp/client_ws.py 206 166 64 0 15% aiohttp/connector.py 710 587 311 0 12% aiohttp/cookiejar.py 256 207 116 0 13% aiohttp/formdata.py 93 76 46 0 12% aiohttp/hdrs.py 94 1 2 1 98% aiohttp/helpers.py 456 284 160 3 30% aiohttp/http.py 11 0 0 0 100% aiohttp/http_exceptions.py 49 20 6 0 53% aiohttp/http_parser.py 482 397 180 1 13% aiohttp/http_websocket.py 379 283 152 0 19% aiohttp/http_writer.py 118 83 50 0 21% aiohttp/locks.py 24 16 4 0 29% aiohttp/log.py 7 0 0 0 100% aiohttp/multipart.py 560 454 234 0 14% aiohttp/payload.py 221 109 58 1 42% aiohttp/payload_streamer.py 29 10 4 0 70% aiohttp/pytest_plugin.py 168 125 44 0 20% aiohttp/resolver.py 68 48 22 0 22% aiohttp/streams.py 393 310 144 0 15% aiohttp/tcp_helpers.py 19 11 6 0 32% aiohttp/test_utils.py 336 229 60 1 27% aiohttp/tracing.py 191 69 32 0 69% aiohttp/typedefs.py 26 1 2 1 93% aiohttp/web.py 117 46 54 11 54% aiohttp/web_app.py 274 117 72 16 51% aiohttp/web_exceptions.py 151 22 6 0 82% aiohttp/web_fileresponse.py 144 120 52 0 12% aiohttp/web_log.py 98 55 18 0 37% aiohttp/web_middlewares.py 56 37 20 0 25% aiohttp/web_protocol.py 335 275 155 0 13% aiohttp/web_request.py 430 282 126 1 28% aiohttp/web_response.py 485 371 212 1 16% aiohttp/web_routedef.py 106 46 10 0 55% aiohttp/web_runner.py 209 98 34 4 47% aiohttp/web_server.py 33 9 4 0 65% aiohttp/web_urldispatcher.py 708 446 163 1 30% aiohttp/web_ws.py 316 254 106 0 15% aiohttp/worker.py 129 121 32 0 5% tests/autobahn/test_autobahn.py 60 52 10 0 11% tests/conftest.py 104 35 18 6 63% tests/test___all__.py 9 0 0 0 100% tests/test_base_protocol.py 152 0 2 0 100% tests/test_circular_imports.py 31 1 15 1 96% tests/test_classbasedview.py 39 2 0 0 95% tests/test_client_connection.py 94 0 2 1 99% tests/test_client_exceptions.py 188 2 18 2 98% tests/test_client_fingerprint.py 59 0 0 0 100% tests/test_client_functional.py 2060 119 68 7 94% tests/test_client_proto.py 94 0 0 0 100% tests/test_client_request.py 751 6 18 0 99% tests/test_client_response.py 469 3 2 1 99% tests/test_client_session.py 496 60 27 2 87% tests/test_client_ws.py 415 0 2 0 100% tests/test_client_ws_functional.py 585 11 14 3 98% tests/test_connector.py 1494 94 66 11 93% tests/test_cookiejar.py 325 0 22 3 99% tests/test_flowcontrol_streams.py 100 0 0 0 100% tests/test_formdata.py 72 0 6 0 100% tests/test_helpers.py 370 7 14 3 97% tests/test_http_exceptions.py 107 0 10 0 100% tests/test_http_parser.py 760 7 36 0 99% tests/test_http_writer.py 182 0 10 0 100% tests/test_locks.py 39 1 0 0 97% tests/test_loop.py 39 2 0 0 95% tests/test_multipart.py 747 4 26 3 99% tests/test_multipart_helpers.py 446 19 0 0 96% tests/test_payload.py 94 5 0 0 95% tests/test_proxy.py 264 18 0 0 93% tests/test_proxy_functional.py 487 487 22 0 0% tests/test_pytest_plugin.py 30 0 0 0 100% tests/test_resolver.py 176 81 12 0 54% tests/test_route_def.py 210 20 0 0 90% tests/test_run_app.py 337 7 24 8 96% tests/test_streams.py 1063 1 40 1 99% tests/test_tcp_helpers.py 52 2 2 1 94% tests/test_test_utils.py 242 5 6 2 97% tests/test_tracing.py 48 0 0 0 100% tests/test_urldispatch.py 844 12 24 1 99% tests/test_web_app.py 420 6 6 0 99% tests/test_web_cli.py 75 0 0 0 100% tests/test_web_exceptions.py 156 0 22 0 100% tests/test_web_functional.py 1514 29 34 4 98% tests/test_web_log.py 110 2 0 0 98% tests/test_web_middleware.py 266 3 12 2 98% tests/test_web_request.py 492 3 8 0 99% tests/test_web_request_handler.py 40 1 0 0 98% tests/test_web_response.py 818 3 4 1 99% tests/test_web_runner.py 128 9 4 0 93% tests/test_web_sendfile.py 84 0 0 0 100% tests/test_web_sendfile_functional.py 634 21 18 0 96% tests/test_web_server.py 110 3 0 0 97% tests/test_web_urldispatcher.py 307 7 16 2 97% tests/test_web_websocket.py 304 2 4 0 99% tests/test_web_websocket_functional.py 542 42 16 4 92% tests/test_websocket_handshake.py 152 0 12 0 100% tests/test_websocket_parser.py 300 9 12 1 97% tests/test_websocket_writer.py 68 17 0 0 75% tests/test_worker.py 197 189 4 0 4% -------------------------------------------------------------------------- TOTAL 30910 8271 3989 113 67% =================================================================================== slowest 10 durations ==================================================================================== 11.00s teardown tests/test_web_functional.py::test_100_continue_for_not_found[pyloop] 10.24s teardown tests/test_web_functional.py::test_100_continue_custom_response[pyloop] 10.21s teardown tests/test_web_functional.py::test_post_max_client_size[pyloop] 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.01s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.01s call tests/test_client_functional.py::test_readline_error_on_conn_close[pyloop] 1.00s call tests/test_client_functional.py::test_timeout_on_reading_data[pyloop] 0.96s call tests/test_payload.py::test_stream_reader_long_lines 0.55s call tests/test_circular_imports.py::test_no_warnings[aiohttp.pytest_plugin] 0.54s call tests/test_pytest_plugin.py::test_aiohttp_plugin ================================================================================== short test summary info ================================================================================== SKIPPED [1] tests/test_worker.py:12: could not import 'aiohttp.worker': No module named 'gunicorn' SKIPPED [1] tests/autobahn/test_autobahn.py:10: 'python-on-whales' requires Python 3.7+ SKIPPED [1] tests/test_client_session.py:800: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1937: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1945: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1956: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2106: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_proxy.py:359: The tested code path is only reachable below Python 3.7 because those versions don't yet have `asyncio.loop.start_tls()` implemeneted SKIPPED [1] tests/test_resolver.py:48: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:58: aiodns required SKIPPED [1] tests/test_resolver.py:69: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:80: aiodns required SKIPPED [1] tests/test_resolver.py:91: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:100: aiodns required SKIPPED [1] tests/test_resolver.py:110: aiodns required SKIPPED [1] tests/test_resolver.py:120: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:212: aiodns required SKIPPED [1] tests/test_resolver.py:224: aiodns required SKIPPED [1] tests/test_resolver.py:231: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:241: aiodns required SKIPPED [1] tests/test_web_app.py:318: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_request.py:693: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_ssl_client[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_ok[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_fail[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-entirely different hosts] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-http -> https] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-https -> http] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_aiohttp_request_ctx_manager_close_sess_on_error[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_error_in_performing_request[pyloop] - reason: trustme is not supported XFAIL tests/test_client_request.py::test_verify_ssl_false_with_ssl_context[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_connector.py::test_tcp_connector_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_sendfile_functional.py::test_static_file_ssl[pyloop] - reason: trustme is not supported XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 FAILED tests/test_client_session.py::test_request_tracing_url_params[pyloop] - AssertionError: assert [URL('http://....0.1:41091/')] == [URL('http://...:41091/?x=0')] ===================================================== 1 failed, 2509 passed, 29 skipped, 11 deselected, 19 xfailed in 140.14s (0:02:20) ===================================================== ```
Dreamsorcerer commented 1 year ago

Use of pkg_resources needs to be dropped.

Right, if you have time to make a PR, that'd be great.

Dreamsorcerer commented 1 year ago

Just reteded aiohttp in updated build env and found that pytest is failing in new unit

7260

kloczek commented 1 year ago

Right, if you have time to make a PR, that'd be great.

Sorry I'm very busy 😞 Maybe next week ..

kloczek commented 1 year ago

Just tested new 3.8.4. pytest is failing now in 10 units

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' -q -p no:randomly --ignore tests/test_proxy_functional.py ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.8.4 configfile: setup.cfg testpaths: tests/ plugins: cov-4.0.0, mock-3.10.0 collected 2567 items / 2 skipped tests/test___all__.py .. [ 0%] tests/test_base_protocol.py .............. [ 0%] tests/test_circular_imports.py FFFF...........................................F [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 4%] tests/test_client_fingerprint.py ............ [ 4%] tests/test_client_functional.py ...............xxx....................................................................................x...................xxx.......x.............x.. [ 10%] ........ [ 10%] tests/test_client_proto.py ........... [ 11%] tests/test_client_request.py .....................................................................................................................x.... [ 15%] tests/test_client_response.py ........................................................ [ 17%] tests/test_client_session.py ......................................F...s...FF...... [ 20%] tests/test_client_ws.py ........................... [ 21%] tests/test_client_ws_functional.py ............................... [ 22%] tests/test_connector.py ....x..................................................................................................sss..xx..s........... [ 27%] tests/test_cookiejar.py ............................................ [ 28%] tests/test_flowcontrol_streams.py ............. [ 29%] tests/test_formdata.py .......... [ 29%] tests/test_helpers.py ................................................................................................... [ 33%] tests/test_http_exceptions.py ................... [ 34%] tests/test_http_parser.py ........................................................................................................................................................... [ 40%] ................................ [ 41%] tests/test_http_writer.py ..................... [ 42%] tests/test_locks.py ... [ 42%] tests/test_loop.py ..... [ 42%] tests/test_multipart.py ........................................................................................................ [ 46%] tests/test_multipart_helpers.py ...............s.................................................ss......ss............................ [ 50%] tests/test_payload.py .............. [ 51%] tests/test_proxy.py .......s........ [ 52%] tests/test_pytest_plugin.py .... [ 52%] tests/test_resolver.py ssssssss.....s.sss.. [ 52%] tests/test_route_def.py ...................... [ 53%] tests/test_run_app.py ............................................... [ 55%] tests/test_streams.py ....................................................................................................... [ 59%] tests/test_tcp_helpers.py ...... [ 59%] tests/test_test_utils.py ................................................ [ 61%] tests/test_tracing.py ................... [ 62%] tests/test_urldispatch.py ............................................................................................................................................ [ 67%] tests/test_web_app.py .......................s........... [ 69%] tests/test_web_cli.py .......... [ 69%] tests/test_web_exceptions.py ................. [ 70%] tests/test_web_functional.py ...........................x................................................................................... [ 74%] tests/test_web_log.py ......... [ 75%] tests/test_web_middleware.py ................................................................................................................... [ 79%] tests/test_web_request.py ...........................................................................s............................ [ 83%] tests/test_web_request_handler.py .... [ 83%] tests/test_web_response.py ................................................................................................................................... [ 88%] tests/test_web_runner.py ..........ss.. [ 89%] tests/test_web_sendfile.py ..... [ 89%] tests/test_web_sendfile_functional.py ................................................x..................................... [ 92%] tests/test_web_server.py .x....... [ 93%] tests/test_web_urldispatcher.py ...........................xxx [ 94%] tests/test_web_websocket.py ............................................ [ 96%] tests/test_web_websocket_functional.py ......................... [ 97%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py .......................................... [ 99%] tests/test_websocket_writer.py ........FF. [100%] ========================================================================================= FAILURES ========================================================================================== ____________________________________________________________________________ test_no_warnings[aiohttp._helpers] _____________________________________________________________________________ import_path = 'aiohttp._helpers' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._helpers' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._helpers')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._helpers' __________________________________________________________________________ test_no_warnings[aiohttp._http_parser] ___________________________________________________________________________ import_path = 'aiohttp._http_parser' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_parser' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._http_parser')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_parser' __________________________________________________________________________ test_no_warnings[aiohttp._http_writer] ___________________________________________________________________________ import_path = 'aiohttp._http_writer' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_writer' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._http_writer')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_writer' ___________________________________________________________________________ test_no_warnings[aiohttp._websocket] ____________________________________________________________________________ import_path = 'aiohttp._websocket' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._websocket' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._websocket')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._websocket' _____________________________________________________________________________ test_no_warnings[aiohttp.worker] ______________________________________________________________________________ import_path = 'aiohttp.worker' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp.worker' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp.worker')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in File "/home/tkloczko/rpmbuild/BUILD/aiohttp-3.8.4/aiohttp/worker.py", line 11, in from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat ModuleNotFoundError: No module named 'gunicorn' __________________________________________________________________________ test_request_tracing_url_params[pyloop] __________________________________________________________________________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False>, aiohttp_client = .go at 0x7fcfaf0c9f70> async def test_request_tracing_url_params(loop: Any, aiohttp_client: Any) -> None: async def root_handler(request): return web.Response() async def redirect_handler(request): raise web.HTTPFound("/") app = web.Application() app.router.add_get("/", root_handler) app.router.add_get("/redirect", redirect_handler) mocks = [mock.Mock(side_effect=make_mocked_coro(mock.Mock())) for _ in range(7)] ( on_request_start, on_request_redirect, on_request_end, on_request_exception, on_request_chunk_sent, on_response_chunk_received, on_request_headers_sent, ) = mocks trace_config = aiohttp.TraceConfig( trace_config_ctx_factory=mock.Mock(return_value=mock.Mock()) ) trace_config.on_request_start.append(on_request_start) trace_config.on_request_redirect.append(on_request_redirect) trace_config.on_request_end.append(on_request_end) trace_config.on_request_exception.append(on_request_exception) trace_config.on_request_chunk_sent.append(on_request_chunk_sent) trace_config.on_response_chunk_received.append(on_response_chunk_received) trace_config.on_request_headers_sent.append(on_request_headers_sent) session = await aiohttp_client(app, trace_configs=[trace_config]) def reset_mocks() -> None: for m in mocks: m.reset_mock() def to_trace_urls(mock_func: mock.Mock) -> List[URL]: return [call_args[0][-1].url for call_args in mock_func.call_args_list] def to_url(path: str) -> URL: return session.make_url(path) # Standard for req in [ lambda: session.get("/?x=0"), lambda: session.get("/", params=dict(x=0)), ]: reset_mocks() async with req() as resp: await resp.text() > assert to_trace_urls(on_request_start) == [to_url("/?x=0")] E AssertionError: assert [URL('http://....0.1:39071/')] == [URL('http://...:39071/?x=0')] E At index 0 diff: URL('http://127.0.0.1:39071/') != URL('http://127.0.0.1:39071/?x=0') E Use -v to get more diff aiohttp_client = .go at 0x7fcfaf0c9f70> app = loop = <_UnixSelectorEventLoop running=False closed=False debug=False> mocks = [, , , , , , ...] on_request_chunk_sent = on_request_end = on_request_exception = on_request_headers_sent = on_request_redirect = on_request_start = on_response_chunk_received = redirect_handler = .redirect_handler at 0x7fcfaf24fca0> req = . at 0x7fcfaf267040> reset_mocks = .reset_mocks at 0x7fcfaf24fe50> resp = root_handler = .root_handler at 0x7fcfaf29d040> session = to_trace_urls = .to_trace_urls at 0x7fcfaf24fee0> to_url = .to_url at 0x7fcfaf24ff70> trace_config = tests/test_client_session.py:669: AssertionError _____________________________________________________________________________ test_client_session_timeout_zero ______________________________________________________________________________ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await asyncio.shield(host_resolved) client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , host = 'example.com', port = 80, traces = [] async def _resolve_host( self, host: str, port: int, traces: Optional[List["Trace"]] = None ) -> List[Dict[str, Any]]: if is_ip_address(host): return [ { "hostname": host, "host": host, "port": port, "family": self._family, "proto": 0, "flags": 0, } ] if not self._use_dns_cache: if traces: for trace in traces: await trace.send_dns_resolvehost_start(host) res = await self._resolver.resolve(host, port, family=self._family) if traces: for trace in traces: await trace.send_dns_resolvehost_end(host) return res key = (host, port) if (key in self._cached_hosts) and (not self._cached_hosts.expired(key)): # get result early, before any await (#4014) result = self._cached_hosts.next_addrs(key) if traces: for trace in traces: await trace.send_dns_cache_hit(host) return result if key in self._throttle_dns_events: # get event early, before any await (#4014) event = self._throttle_dns_events[key] if traces: for trace in traces: await trace.send_dns_cache_hit(host) await event.wait() else: # update dict early, before any await (#4014) self._throttle_dns_events[key] = EventResultOrError(self._loop) if traces: for trace in traces: await trace.send_dns_cache_miss(host) try: if traces: for trace in traces: await trace.send_dns_resolvehost_start(host) > addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:874: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , hostname = 'example.com', port = 80, family = 0 async def resolve( self, hostname: str, port: int = 0, family: int = socket.AF_INET ) -> List[Dict[str, Any]]: > infos = await self._loop.getaddrinfo( hostname, port, type=socket.SOCK_STREAM, family=family, flags=socket.AI_ADDRCONFIG, ) family = 0 hostname = 'example.com' port = 80 self = ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/resolver.py:33: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_UnixSelectorEventLoop running=False closed=False debug=False>, host = 'example.com', port = 80 async def getaddrinfo(self, host, port, *, family=0, type=0, proto=0, flags=0): if self._debug: getaddr_func = self._getaddrinfo_debug else: getaddr_func = socket.getaddrinfo > return await self.run_in_executor( None, getaddr_func, host, port, family, type, proto, flags) family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.8/asyncio/base_events.py:825: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = None def run(self): if not self.future.set_running_or_notify_cancel(): return try: > result = self.fn(*self.args, **self.kwargs) self = None /usr/lib64/python3.8/concurrent/futures/thread.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = , proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.8/socket.py:918: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) tests/test_client_session.py:846: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/client.py:536: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_redirects = 10 method = 'GET' params = None proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) redirects = 0 req = self = skip_auto_headers = None skip_headers = set() ssl = None ssl_context = None str_or_url = 'http://example.com' timeout = timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:540: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:901: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1166: ClientConnectorError _____________________________________________________________________________ test_requote_redirect_url_default _____________________________________________________________________________ cls = , func = . at 0x7fcfaf047820>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.039449483971111476 excinfo = \n') tblen=6> func = . at 0x7fcfaf047820> precise_start = 806685.247442038 precise_stop = 806685.286891522 reraise = (, ) result = None start = 1685812279.0883474 stop = 1685812279.127798 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = <_HookCaller 'pytest_runtest_call'> item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265: in __call__ return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) argname = 'item' args = () firstresult = False kwargs = {'item': } self = <_HookCaller 'pytest_runtest_call'> /usr/lib/python3.8/site-packages/pluggy/_manager.py:80: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7fcfb3782460> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 568, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fcfaeb04520> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning __________________________________________________________________________________ test_send_compress_text __________________________________________________________________________________ __wrapped_mock_method__ = , args = (, b'\xc1\x05*\x01b\x00\x00'), kwargs = {} __tracebackhide__ = True msg = "expected call not found.\nExpected: write(b'\\xc1\\x05*\\x01b\\x00\\x00')\nActual: write(b'\\xc1\\x04\\x02a\\x00\\x00...\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" __mock_self = , actual_args = (b'\xc1\x04\x02a\x00\x00',), actual_kwargs = {} introspection = "\nArgs:\nassert (b'\\xc1\\x04\\x02a\\x00\\x00',) == (b'\\xc1\\x05*\\x01b\\x00\\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" @py_assert2 = (b'\xc1\x05*\x01b\x00\x00',), @py_assert1 = None @py_format4 = "(b'\\xc1\\x04\\x02a\\x00\\x00',) == (b'\\xc1\\x05*\\x01b\\x00\\x00',)\n~At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n~Use -v to get more diff" def assert_wrapper( __wrapped_mock_method__: Callable[..., Any], *args: Any, **kwargs: Any ) -> None: __tracebackhide__ = True try: > __wrapped_mock_method__(*args, **kwargs) __mock_self = __tracebackhide__ = True __wrapped_mock_method__ = actual_args = (b'\xc1\x04\x02a\x00\x00',) actual_kwargs = {} args = (, b'\xc1\x05*\x01b\x00\x00') introspection = "\nArgs:\nassert (b'\\xc1\\x04\\x02a\\x00\\x00',) == (b'\\xc1\\x05*\\x01b\\x00\\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" kwargs = {} msg = "expected call not found.\nExpected: write(b'\\xc1\\x05*\\x01b\\x00\\x00')\nActual: write(b'\\xc1\\x04\\x02a\\x00\\x00...\x00',)\n At index 0 diff: b'\\xc1\\x04\\x02a\\x00\\x00' != b'\\xc1\\x05*\\x01b\\x00\\x00'\n Use -v to get more diff" /usr/lib/python3.8/site-packages/pytest_mock/plugin.py:444: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {}, expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) actual = call(b'\xc1\x04\x02a\x00\x00'), _error_message = ._error_message at 0x7fcfafb254c0>, cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher((args, kwargs)) actual = self._call_matcher(self.call_args) if expected != actual: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7fcfafb254c0> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) kwargs = {} self = /usr/lib64/python3.8/unittest/mock.py:913: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:88: AssertionError ____________________________________________________________________________ test_send_compress_text_notakeover _____________________________________________________________________________ cls = , func = . at 0x7fcfae7f89d0>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.051310979994013906 excinfo = \n') tblen=6> func = . at 0x7fcfae7f89d0> precise_start = 806783.042975836 precise_stop = 806783.094286816 reraise = (, ) result = None start = 1685812376.8838813 stop = 1685812376.9351935 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = <_HookCaller 'pytest_runtest_call'> item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:265: in __call__ return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) argname = 'item' args = () firstresult = False kwargs = {'item': } self = <_HookCaller 'pytest_runtest_call'> /usr/lib/python3.8/site-packages/pluggy/_manager.py:80: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7fcfb3782460> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.4-3.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 568, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fcfafad8910> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ---------- coverage: platform linux, python 3.8.16-final-0 ----------- Name Stmts Miss Branch BrPart Cover -------------------------------------------------------------------------- aiohttp/__init__.py 18 1 0 0 94% aiohttp/abc.py 90 6 0 0 93% aiohttp/base_protocol.py 66 51 22 0 17% aiohttp/client.py 475 355 168 1 19% aiohttp/client_exceptions.py 135 61 16 0 49% aiohttp/client_proto.py 146 118 54 0 14% aiohttp/client_reqrep.py 642 485 280 0 18% aiohttp/client_ws.py 206 166 64 0 15% aiohttp/connector.py 710 587 311 0 12% aiohttp/cookiejar.py 256 207 116 0 13% aiohttp/formdata.py 93 76 46 0 12% aiohttp/hdrs.py 94 1 2 1 98% aiohttp/helpers.py 456 284 160 3 30% aiohttp/http.py 11 0 0 0 100% aiohttp/http_exceptions.py 49 20 6 0 53% aiohttp/http_parser.py 482 397 180 1 13% aiohttp/http_websocket.py 379 283 152 0 19% aiohttp/http_writer.py 118 83 50 0 21% aiohttp/locks.py 24 16 4 0 29% aiohttp/log.py 7 0 0 0 100% aiohttp/multipart.py 560 454 234 0 14% aiohttp/payload.py 221 109 58 1 42% aiohttp/payload_streamer.py 29 10 4 0 70% aiohttp/pytest_plugin.py 168 125 44 0 20% aiohttp/resolver.py 68 48 22 0 22% aiohttp/streams.py 393 310 144 0 15% aiohttp/tcp_helpers.py 19 11 6 0 32% aiohttp/test_utils.py 336 229 60 1 27% aiohttp/tracing.py 191 69 32 0 69% aiohttp/typedefs.py 26 1 2 1 93% aiohttp/web.py 117 46 54 11 54% aiohttp/web_app.py 274 117 72 16 51% aiohttp/web_exceptions.py 151 22 6 0 82% aiohttp/web_fileresponse.py 144 120 52 0 12% aiohttp/web_log.py 98 55 18 0 37% aiohttp/web_middlewares.py 56 37 20 0 25% aiohttp/web_protocol.py 335 275 155 0 13% aiohttp/web_request.py 430 282 126 1 28% aiohttp/web_response.py 485 371 212 1 16% aiohttp/web_routedef.py 106 46 10 0 55% aiohttp/web_runner.py 209 98 34 4 47% aiohttp/web_server.py 33 9 4 0 65% aiohttp/web_urldispatcher.py 708 446 163 1 30% aiohttp/web_ws.py 316 254 106 0 15% aiohttp/worker.py 129 121 32 0 5% tests/autobahn/test_autobahn.py 60 52 10 0 11% tests/conftest.py 104 35 18 6 63% tests/test___all__.py 9 0 0 0 100% tests/test_base_protocol.py 152 0 2 0 100% tests/test_circular_imports.py 31 1 15 1 96% tests/test_classbasedview.py 39 2 0 0 95% tests/test_client_connection.py 94 0 2 1 99% tests/test_client_exceptions.py 188 2 18 2 98% tests/test_client_fingerprint.py 59 0 0 0 100% tests/test_client_functional.py 2060 119 68 7 94% tests/test_client_proto.py 94 0 0 0 100% tests/test_client_request.py 751 6 18 0 99% tests/test_client_response.py 469 3 2 1 99% tests/test_client_session.py 496 49 27 2 89% tests/test_client_ws.py 415 0 2 0 100% tests/test_client_ws_functional.py 585 11 14 3 98% tests/test_connector.py 1494 94 66 11 93% tests/test_cookiejar.py 325 0 22 3 99% tests/test_flowcontrol_streams.py 100 0 0 0 100% tests/test_formdata.py 72 0 6 0 100% tests/test_helpers.py 370 7 14 3 97% tests/test_http_exceptions.py 107 0 10 0 100% tests/test_http_parser.py 760 7 36 0 99% tests/test_http_writer.py 182 0 10 0 100% tests/test_locks.py 39 1 0 0 97% tests/test_loop.py 39 2 0 0 95% tests/test_multipart.py 747 4 26 3 99% tests/test_multipart_helpers.py 446 19 0 0 96% tests/test_payload.py 94 5 0 0 95% tests/test_proxy.py 264 18 0 0 93% tests/test_proxy_functional.py 487 487 22 0 0% tests/test_pytest_plugin.py 30 0 0 0 100% tests/test_resolver.py 176 81 12 0 54% tests/test_route_def.py 210 20 0 0 90% tests/test_run_app.py 337 7 24 8 96% tests/test_streams.py 1063 1 40 1 99% tests/test_tcp_helpers.py 52 2 2 1 94% tests/test_test_utils.py 242 5 6 2 97% tests/test_tracing.py 48 0 0 0 100% tests/test_urldispatch.py 844 12 24 1 99% tests/test_web_app.py 420 6 6 0 99% tests/test_web_cli.py 75 0 0 0 100% tests/test_web_exceptions.py 156 0 22 0 100% tests/test_web_functional.py 1514 29 34 4 98% tests/test_web_log.py 110 2 0 0 98% tests/test_web_middleware.py 266 3 12 2 98% tests/test_web_request.py 492 3 8 0 99% tests/test_web_request_handler.py 40 1 0 0 98% tests/test_web_response.py 818 3 4 1 99% tests/test_web_runner.py 128 9 4 0 93% tests/test_web_sendfile.py 84 0 0 0 100% tests/test_web_sendfile_functional.py 634 21 18 0 96% tests/test_web_server.py 110 3 0 0 97% tests/test_web_urldispatcher.py 307 7 16 2 97% tests/test_web_websocket.py 304 2 4 0 99% tests/test_web_websocket_functional.py 542 42 16 4 92% tests/test_websocket_handshake.py 152 0 12 0 100% tests/test_websocket_parser.py 300 9 12 1 97% tests/test_websocket_writer.py 68 0 0 0 100% tests/test_worker.py 197 189 4 0 4% -------------------------------------------------------------------------- TOTAL 30910 8243 3989 113 67% =================================================================================== slowest 10 durations ==================================================================================== 11.04s teardown tests/test_web_functional.py::test_post_max_client_size[pyloop] 11.00s teardown tests/test_web_functional.py::test_100_continue_for_not_found[pyloop] 10.50s teardown tests/test_web_functional.py::test_100_continue_custom_response[pyloop] 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.01s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.01s call tests/test_client_functional.py::test_readline_error_on_conn_close[pyloop] 1.00s call tests/test_client_functional.py::test_timeout_on_reading_data[pyloop] 0.98s call tests/test_payload.py::test_stream_reader_long_lines 0.60s call tests/test_circular_imports.py::test_no_warnings[aiohttp.pytest_plugin] 0.56s call tests/test_pytest_plugin.py::test_aiohttp_plugin ================================================================================== short test summary info ================================================================================== SKIPPED [1] tests/test_worker.py:12: could not import 'aiohttp.worker': No module named 'gunicorn' SKIPPED [1] tests/autobahn/test_autobahn.py:10: 'python-on-whales' requires Python 3.7+ SKIPPED [1] tests/test_client_session.py:800: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1937: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1945: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1956: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2106: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_proxy.py:359: The tested code path is only reachable below Python 3.7 because those versions don't yet have `asyncio.loop.start_tls()` implemeneted SKIPPED [1] tests/test_resolver.py:48: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:58: aiodns required SKIPPED [1] tests/test_resolver.py:69: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:80: aiodns required SKIPPED [1] tests/test_resolver.py:91: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:100: aiodns required SKIPPED [1] tests/test_resolver.py:110: aiodns required SKIPPED [1] tests/test_resolver.py:120: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:212: aiodns required SKIPPED [1] tests/test_resolver.py:224: aiodns required SKIPPED [1] tests/test_resolver.py:231: aiodns 1.1 required SKIPPED [1] tests/test_resolver.py:241: aiodns required SKIPPED [1] tests/test_web_app.py:318: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_request.py:693: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_ssl_client[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_ok[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_fail[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-entirely different hosts] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-http -> https] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-https -> http] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_aiohttp_request_ctx_manager_close_sess_on_error[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_error_in_performing_request[pyloop] - reason: trustme is not supported XFAIL tests/test_client_request.py::test_verify_ssl_false_with_ssl_context[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_connector.py::test_tcp_connector_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_sendfile_functional.py::test_static_file_ssl[pyloop] - reason: trustme is not supported XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._helpers] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_parser] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_writer] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._websocket] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp.worker] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_client_session.py::test_request_tracing_url_params[pyloop] - AssertionError: assert [URL('http://....0.1:39071/')] == [URL('http://...:39071/?x=0')] FAILED tests/test_client_session.py::test_client_session_timeout_zero - aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] FAILED tests/test_client_session.py::test_requote_redirect_url_default - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionError: expected call not found. FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - pytest.PytestUnraisableExceptionWarning: Exception ignored in: ============================================================ 10 failed, 2511 passed, 29 skipped, 19 xfailed in 151.32s (0:02:31) ============================================================ ```
kloczek commented 1 year ago

Updated pytest for 3.8.6

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' -q -p no:randomly --ignore tests/test_proxy_functional.py ============================= test session starts ============================== platform linux -- Python 3.8.18, pytest-7.4.2, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.8.6 configfile: setup.cfg testpaths: tests/ plugins: cov-4.1.0, mock-3.11.1 collected 2605 items / 2 skipped tests/test___all__.py .. [ 0%] tests/test_base_protocol.py .............. [ 0%] tests/test_circular_imports.py FFFF..................................... [ 2%] ......F [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 3%] tests/test_client_fingerprint.py ............ [ 4%] tests/test_client_functional.py ...............xxx...................... [ 5%] ..............................................................x......... [ 8%] ..........xxx.......x.............x.......... [ 10%] tests/test_client_proto.py ........... [ 10%] tests/test_client_request.py ........................................... [ 12%] ........................................................................ [ 15%] ..x.... [ 15%] tests/test_client_response.py .......................................... [ 17%] .............. [ 17%] tests/test_client_session.py ......................................F...s [ 19%] ...FF...... [ 19%] tests/test_client_ws.py ........................... [ 20%] tests/test_client_ws_functional.py ............................... [ 22%] tests/test_connector.py ....x........................................... [ 23%] .......................................................sss..xx..s....... [ 26%] .... [ 26%] tests/test_cookiejar.py ............................................. [ 28%] tests/test_flowcontrol_streams.py ............. [ 29%] tests/test_formdata.py .......... [ 29%] tests/test_helpers.py .................................................. [ 31%] .................................................. [ 33%] tests/test_http_exceptions.py ................... [ 33%] tests/test_http_parser.py .............................................. [ 35%] ........................................................................ [ 38%] ...............................xF....FF................................. [ 41%] ....x............................ [ 42%] tests/test_http_writer.py ..................... [ 43%] tests/test_locks.py ... [ 43%] tests/test_loop.py ..... [ 43%] tests/test_multipart.py ................................................ [ 45%] ........................................................ [ 47%] tests/test_multipart_helpers.py ...............s........................ [ 49%] .........................ss......ss............................ [ 51%] tests/test_payload.py .............. [ 52%] tests/test_proxy.py .......s........ [ 52%] tests/test_pytest_plugin.py .... [ 52%] tests/test_resolver.py .................... [ 53%] tests/test_route_def.py ...................... [ 54%] tests/test_run_app.py ............................................... [ 56%] tests/test_streams.py .................................................. [ 58%] ..................................................... [ 60%] tests/test_tcp_helpers.py ...... [ 60%] tests/test_test_utils.py ............................................... [ 62%] . [ 62%] tests/test_tracing.py ................... [ 63%] tests/test_urldispatch.py .............................................. [ 64%] ........................................................................ [ 67%] ...................... [ 68%] tests/test_web_app.py .......................s........... [ 69%] tests/test_web_cli.py .......... [ 70%] tests/test_web_exceptions.py ................. [ 70%] tests/test_web_functional.py ...........................x............... [ 72%] .................................................................... [ 75%] tests/test_web_log.py ......... [ 75%] tests/test_web_middleware.py ........................................... [ 77%] ........................................................................ [ 79%] [ 79%] tests/test_web_request.py .............................................. [ 81%] .............................s............................ [ 83%] tests/test_web_request_handler.py .... [ 83%] tests/test_web_response.py ............................................. [ 85%] ........................................................................ [ 88%] .............. [ 89%] tests/test_web_runner.py ..........ss.. [ 89%] tests/test_web_sendfile.py ..... [ 89%] tests/test_web_sendfile_functional.py .................................. [ 91%] ..............x..................................... [ 93%] tests/test_web_server.py .x....... [ 93%] tests/test_web_urldispatcher.py ...........................xxx [ 94%] tests/test_web_websocket.py ............................................ [ 96%] [ 96%] tests/test_web_websocket_functional.py ......................... [ 97%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py ......................................... [ 99%] . [ 99%] tests/test_websocket_writer.py ........FF. [100%] =================================== FAILURES =================================== ______________________ test_no_warnings[aiohttp._helpers] ______________________ import_path = 'aiohttp._helpers' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._helpers' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) kwargs = {}, retcode = 1 cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._helpers')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._helpers' ____________________ test_no_warnings[aiohttp._http_parser] ____________________ import_path = 'aiohttp._http_parser' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_parser' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) kwargs = {}, retcode = 1 cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._http_parser')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_parser' ____________________ test_no_warnings[aiohttp._http_writer] ____________________ import_path = 'aiohttp._http_writer' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_writer' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) kwargs = {}, retcode = 1 cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._http_writer')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_writer' _____________________ test_no_warnings[aiohttp._websocket] _____________________ import_path = 'aiohttp._websocket' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._websocket' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) kwargs = {}, retcode = 1 cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp._websocket')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._websocket' _______________________ test_no_warnings[aiohttp.worker] _______________________ import_path = 'aiohttp.worker' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # The following deprecation warning is coming from an old # version of `setuptools` (the last one to support Python 3.6). # It is stepping on it's own toes. But since it doesn't # originate in aiohttp, we don't care much about it. "-W", "ignore:Creating a LegacyVersion has been deprecated and will " "be removed in the next major release:DeprecationWarning:", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp.worker' tests/test_circular_imports.py:120: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) kwargs = {}, retcode = 1 cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-c', 'import aiohttp.worker')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "", line 1, in File "/home/tkloczko/rpmbuild/BUILD/aiohttp-3.8.6/aiohttp/worker.py", line 11, in from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat ModuleNotFoundError: No module named 'gunicorn' ___________________ test_request_tracing_url_params[pyloop] ____________________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> aiohttp_client = .go at 0x7f928b871430> async def test_request_tracing_url_params(loop: Any, aiohttp_client: Any) -> None: async def root_handler(request): return web.Response() async def redirect_handler(request): raise web.HTTPFound("/") app = web.Application() app.router.add_get("/", root_handler) app.router.add_get("/redirect", redirect_handler) mocks = [mock.Mock(side_effect=make_mocked_coro(mock.Mock())) for _ in range(7)] ( on_request_start, on_request_redirect, on_request_end, on_request_exception, on_request_chunk_sent, on_response_chunk_received, on_request_headers_sent, ) = mocks trace_config = aiohttp.TraceConfig( trace_config_ctx_factory=mock.Mock(return_value=mock.Mock()) ) trace_config.on_request_start.append(on_request_start) trace_config.on_request_redirect.append(on_request_redirect) trace_config.on_request_end.append(on_request_end) trace_config.on_request_exception.append(on_request_exception) trace_config.on_request_chunk_sent.append(on_request_chunk_sent) trace_config.on_response_chunk_received.append(on_response_chunk_received) trace_config.on_request_headers_sent.append(on_request_headers_sent) session = await aiohttp_client(app, trace_configs=[trace_config]) def reset_mocks() -> None: for m in mocks: m.reset_mock() def to_trace_urls(mock_func: mock.Mock) -> List[URL]: return [call_args[0][-1].url for call_args in mock_func.call_args_list] def to_url(path: str) -> URL: return session.make_url(path) # Standard for req in [ lambda: session.get("/?x=0"), lambda: session.get("/", params=dict(x=0)), ]: reset_mocks() async with req() as resp: await resp.text() > assert to_trace_urls(on_request_start) == [to_url("/?x=0")] E AssertionError: assert [URL('http://....0.1:37859/')] == [URL('http://...:37859/?x=0')] E At index 0 diff: URL('http://127.0.0.1:37859/') != URL('http://127.0.0.1:37859/?x=0') E Use -v to get more diff aiohttp_client = .go at 0x7f928b871430> app = loop = <_UnixSelectorEventLoop running=False closed=False debug=False> mocks = [, , , , , , ...] on_request_chunk_sent = on_request_end = on_request_exception = on_request_headers_sent = on_request_redirect = on_request_start = on_response_chunk_received = redirect_handler = .redirect_handler at 0x7f928a96a670> req = . at 0x7f928a96adc0> reset_mocks = .reset_mocks at 0x7f928a96ac10> resp = root_handler = .root_handler at 0x7f928a96a5e0> session = to_trace_urls = .to_trace_urls at 0x7f928a96aca0> to_url = .to_url at 0x7f928a96ad30> trace_config = tests/test_client_session.py:669: AssertionError _______________________ test_client_session_timeout_zero _______________________ self = req = traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await asyncio.shield(host_resolved) client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1155: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:874: in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/resolver.py:33: in resolve infos = await self._loop.getaddrinfo( family = 0 hostname = 'example.com' port = 80 self = /usr/lib64/python3.8/asyncio/base_events.py:825: in getaddrinfo return await self.run_in_executor( family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.8/concurrent/futures/thread.py:57: in run result = self.fn(*self.args, **self.kwargs) self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.8/socket.py:918: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) tests/test_client_session.py:846: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/client.py:562: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_redirects = 10 method = 'GET' params = None proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) redirects = 0 req = self = skip_auto_headers = None skip_headers = set() ssl = None ssl_context = None str_or_url = 'http://example.com' timeout = timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:540: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:901: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = req = traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) async def _create_direct_connection( self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0) traces = [] ../../BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1169: ClientConnectorError ______________________ test_requote_redirect_url_default _______________________ cls = func = . at 0x7f928b58b700> when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.03625695896334946 excinfo = \n') tblen=7> func = . at 0x7f928b58b700> precise_start = 1465207.012296936 precise_stop = 1465207.048553895 reraise = (, ) result = None start = 1696697469.2550974 stop = 1696697469.2913556 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f928e6c8880> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 568, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f928a7ff2b0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning __________ test_http_response_parser_strict_headers[c-parser-pyloop] ___________ response = @pytest.mark.dev_mode def test_http_response_parser_strict_headers(response) -> None: if isinstance(response, HttpResponseParserPy): pytest.xfail("Py parser is lenient. May update py-parser later.") with pytest.raises(http_exceptions.BadHttpMessage): > response.feed_data(b"HTTP/1.1 200 test\r\nFoo: abc\x01def\r\n\r\n") E Failed: DID NOT RAISE response = tests/test_http_parser.py:831: Failed ___________ test_http_response_parser_bad_chunked_strict_py[pyloop] ____________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = @pytest.mark.dev_mode async def test_http_response_parser_bad_chunked_strict_py(loop, protocol) -> None: response = HttpResponseParserPy( protocol, loop, 2**16, max_line_size=8190, max_field_size=8190, ) text = ( b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n5 \r\nabcde\r\n0\r\n\r\n" ) messages, upgrade, tail = response.feed_data(text) > assert isinstance(messages[0][1].exception(), http_exceptions.TransferEncodingError) E AssertionError: assert False E + where False = isinstance(None, ) E + where None = >() E + where > = .exception E + and = http_exceptions.TransferEncodingError loop = <_UnixSelectorEventLoop running=False closed=False debug=False> messages = [(, )] protocol = response = tail = b'' text = b'HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n5 \r\nabcde\r\n0\r\n\r\n' upgrade = False tests/test_http_parser.py:867: AssertionError ____________ test_http_response_parser_bad_chunked_strict_c[pyloop] ____________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = @pytest.mark.dev_mode @pytest.mark.skipif( "HttpRequestParserC" not in dir(aiohttp.http_parser), reason="C based HTTP parser not available", ) async def test_http_response_parser_bad_chunked_strict_c(loop, protocol) -> None: response = HttpResponseParserC( protocol, loop, 2**16, max_line_size=8190, max_field_size=8190, ) text = ( b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n5 \r\nabcde\r\n0\r\n\r\n" ) with pytest.raises(http_exceptions.BadHttpMessage): > response.feed_data(text) E Failed: DID NOT RAISE loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = response = text = b'HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n5 \r\nabcde\r\n0\r\n\r\n' tests/test_http_parser.py:887: Failed ___________________________ test_send_compress_text ____________________________ self = args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {} expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) actual = call(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7f9289952280> cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher((args, kwargs)) actual = self._call_matcher(self.call_args) if expected != actual: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7f9289952280> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) kwargs = {} self = /usr/lib64/python3.8/unittest/mock.py:913: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:88: AssertionError ______________________ test_send_compress_text_notakeover ______________________ cls = func = . at 0x7f9289952c10> when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.04443942406214774 excinfo = \n') tblen=7> func = . at 0x7f9289952c10> precise_start = 1465300.338664626 precise_stop = 1465300.38310405 reraise = (, ) result = None start = 1696697562.5814648 stop = 1696697562.6259058 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f928e6c8880> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.8.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 568, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f92887125e0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ---------- coverage: platform linux, python 3.8.18-final-0 ----------- Name Stmts Miss Branch BrPart Cover -------------------------------------------------------------------------- aiohttp/__init__.py 18 1 0 0 94% aiohttp/abc.py 90 6 0 0 93% aiohttp/base_protocol.py 66 51 22 0 17% aiohttp/client.py 484 360 170 1 19% aiohttp/client_exceptions.py 135 61 16 0 49% aiohttp/client_proto.py 146 118 54 0 14% aiohttp/client_reqrep.py 638 482 280 0 18% aiohttp/client_ws.py 206 166 64 0 15% aiohttp/connector.py 713 590 313 0 12% aiohttp/cookiejar.py 256 207 117 0 13% aiohttp/formdata.py 93 76 46 0 12% aiohttp/hdrs.py 94 1 2 1 98% aiohttp/helpers.py 460 287 160 3 30% aiohttp/http.py 11 0 0 0 100% aiohttp/http_exceptions.py 51 21 6 0 53% aiohttp/http_parser.py 500 407 202 2 14% aiohttp/http_websocket.py 379 283 152 0 19% aiohttp/http_writer.py 118 83 50 0 21% aiohttp/locks.py 24 16 4 0 29% aiohttp/log.py 7 0 0 0 100% aiohttp/multipart.py 560 454 234 0 14% aiohttp/payload.py 221 109 58 1 42% aiohttp/payload_streamer.py 29 10 4 0 70% aiohttp/pytest_plugin.py 168 125 44 0 20% aiohttp/resolver.py 68 48 22 0 22% aiohttp/streams.py 393 310 144 0 15% aiohttp/tcp_helpers.py 19 11 6 0 32% aiohttp/test_utils.py 336 229 60 1 27% aiohttp/tracing.py 191 69 32 0 69% aiohttp/typedefs.py 26 1 2 1 93% aiohttp/web.py 117 46 54 11 54% aiohttp/web_app.py 274 117 72 16 51% aiohttp/web_exceptions.py 151 22 6 0 82% aiohttp/web_fileresponse.py 144 120 52 0 12% aiohttp/web_log.py 98 55 18 0 37% aiohttp/web_middlewares.py 56 37 20 0 25% aiohttp/web_protocol.py 335 275 155 0 13% aiohttp/web_request.py 430 282 126 1 28% aiohttp/web_response.py 485 371 212 1 16% aiohttp/web_routedef.py 106 46 10 0 55% aiohttp/web_runner.py 209 98 34 4 47% aiohttp/web_server.py 33 9 4 0 65% aiohttp/web_urldispatcher.py 708 446 163 1 30% aiohttp/web_ws.py 316 254 106 0 15% aiohttp/worker.py 129 121 32 0 5% tests/autobahn/test_autobahn.py 60 52 10 0 11% tests/conftest.py 104 35 18 6 63% tests/test___all__.py 9 0 0 0 100% tests/test_base_protocol.py 152 0 2 0 100% tests/test_circular_imports.py 31 1 15 1 96% tests/test_classbasedview.py 39 2 0 0 95% tests/test_client_connection.py 94 0 2 1 99% tests/test_client_exceptions.py 188 2 18 2 98% tests/test_client_fingerprint.py 59 0 0 0 100% tests/test_client_functional.py 2060 119 68 7 94% tests/test_client_proto.py 94 0 0 0 100% tests/test_client_request.py 751 6 18 0 99% tests/test_client_response.py 457 3 4 1 99% tests/test_client_session.py 496 49 27 2 89% tests/test_client_ws.py 415 0 2 0 100% tests/test_client_ws_functional.py 585 11 14 3 98% tests/test_connector.py 1494 94 66 11 93% tests/test_cookiejar.py 342 0 22 3 99% tests/test_flowcontrol_streams.py 100 0 0 0 100% tests/test_formdata.py 72 0 6 0 100% tests/test_helpers.py 383 7 16 3 97% tests/test_http_exceptions.py 109 0 10 0 100% tests/test_http_parser.py 835 7 40 0 99% tests/test_http_writer.py 182 0 10 0 100% tests/test_locks.py 39 1 0 0 97% tests/test_loop.py 39 2 0 0 95% tests/test_multipart.py 747 4 26 3 99% tests/test_multipart_helpers.py 446 19 0 0 96% tests/test_payload.py 94 5 0 0 95% tests/test_proxy.py 264 18 0 0 93% tests/test_proxy_functional.py 487 487 22 0 0% tests/test_pytest_plugin.py 30 0 0 0 100% tests/test_resolver.py 176 12 12 0 94% tests/test_route_def.py 210 20 0 0 90% tests/test_run_app.py 337 7 24 8 96% tests/test_streams.py 1063 1 40 1 99% tests/test_tcp_helpers.py 52 2 2 1 94% tests/test_test_utils.py 242 5 6 2 97% tests/test_tracing.py 48 0 0 0 100% tests/test_urldispatch.py 844 12 24 1 99% tests/test_web_app.py 420 6 6 0 99% tests/test_web_cli.py 75 0 0 0 100% tests/test_web_exceptions.py 156 0 22 0 100% tests/test_web_functional.py 1514 29 34 4 98% tests/test_web_log.py 110 2 0 0 98% tests/test_web_middleware.py 266 3 12 2 98% tests/test_web_request.py 492 3 8 0 99% tests/test_web_request_handler.py 40 1 0 0 98% tests/test_web_response.py 818 3 4 1 99% tests/test_web_runner.py 128 9 4 0 93% tests/test_web_sendfile.py 84 0 0 0 100% tests/test_web_sendfile_functional.py 634 21 18 0 96% tests/test_web_server.py 110 3 0 0 97% tests/test_web_urldispatcher.py 307 7 16 2 97% tests/test_web_websocket.py 304 2 4 0 99% tests/test_web_websocket_functional.py 542 42 16 4 92% tests/test_websocket_handshake.py 152 0 12 0 100% tests/test_websocket_parser.py 300 9 12 1 97% tests/test_websocket_writer.py 68 0 0 0 100% tests/test_worker.py 197 189 4 0 4% -------------------------------------------------------------------------- TOTAL 31037 8193 4024 114 67% ============================= slowest 10 durations ============================= 11.00s teardown tests/test_web_functional.py::test_100_continue_for_not_found[pyloop] 10.36s teardown tests/test_web_functional.py::test_100_continue_custom_response[pyloop] 10.26s teardown tests/test_web_functional.py::test_post_max_client_size[pyloop] 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.01s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.01s call tests/test_client_functional.py::test_readline_error_on_conn_close[pyloop] 1.00s call tests/test_client_functional.py::test_timeout_on_reading_data[pyloop] 0.87s call tests/test_payload.py::test_stream_reader_long_lines 0.75s call tests/test_circular_imports.py::test_no_warnings[aiohttp.pytest_plugin] 0.59s call tests/test_circular_imports.py::test_no_warnings[aiohttp.web_app] =========================== short test summary info ============================ SKIPPED [1] tests/test_worker.py:12: could not import 'aiohttp.worker': No module named 'gunicorn' SKIPPED [1] tests/autobahn/test_autobahn.py:10: 'python-on-whales' requires Python 3.7+ SKIPPED [1] tests/test_client_session.py:800: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1937: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1945: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1956: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2106: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_proxy.py:359: The tested code path is only reachable below Python 3.7 because those versions don't yet have `asyncio.loop.start_tls()` implemeneted SKIPPED [1] tests/test_web_app.py:319: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_request.py:693: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_ssl_client[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_ok[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_fail[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-entirely different hosts] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-http -> https] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-https -> http] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_aiohttp_request_ctx_manager_close_sess_on_error[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_error_in_performing_request[pyloop] - reason: trustme is not supported XFAIL tests/test_client_request.py::test_verify_ssl_false_with_ssl_context[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_connector.py::test_tcp_connector_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_http_parser.py::test_http_response_parser_strict_headers[py-parser-pyloop] - reason: Py parser is lenient. May update py-parser later. XFAIL tests/test_http_parser.py::test_parse_uri_utf8[c-parser-pyloop] - reason: Not valid HTTP. Maybe update py-parser to reject later. XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_sendfile_functional.py::test_static_file_ssl[pyloop] - reason: trustme is not supported XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._helpers] - s... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_parser] FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_writer] FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._websocket] FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp.worker] - sub... FAILED tests/test_client_session.py::test_request_tracing_url_params[pyloop] FAILED tests/test_client_session.py::test_client_session_timeout_zero - aioht... FAILED tests/test_client_session.py::test_requote_redirect_url_default - pyte... FAILED tests/test_http_parser.py::test_http_response_parser_strict_headers[c-parser-pyloop] FAILED tests/test_http_parser.py::test_http_response_parser_bad_chunked_strict_py[pyloop] FAILED tests/test_http_parser.py::test_http_response_parser_bad_chunked_strict_c[pyloop] FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionErr... FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - p... ===== 13 failed, 2556 passed, 17 skipped, 21 xfailed in 149.48s (0:02:29) ====== ```
Dreamsorcerer commented 1 year ago

Wait, hang on. I think you might need to change the pytest command. The strict tests are tagged with dev_mode, they should only be run under Python's development mode. The pytest config adds -m "not dev_mode" by default. Seems like that's got lost when you run it.

Dreamsorcerer commented 1 year ago

Our CI does a 2nd pytest invocation that runs the dev_mode tests separately: https://github.com/aio-libs/aiohttp/blob/master/.github/workflows/ci-cd.yml#L246

kloczek commented 1 year ago

Wait, hang on. I think you might need to change the pytest command. The strict tests are tagged with dev_mode, they should only be run under Python's development mode. The pytest config adds -m "not dev_mode" by default. Seems like that's got lost when you run it.

So should I run pytest the same way? 🤔

Dreamsorcerer commented 1 year ago

Well, you'll probably need to add -m "not dev_mode" to what you currently run. My understanding is that it should have done this automatically from the config in setup.cfg, so not sure why that didn't work for you.

Then, if you want to run all the tests, you'll need to do a second pytest run with dev mode enabled, as per the CI code (dev_mode is <10 tests though, so it's not a major concern if you don't run it).

kloczek commented 11 months ago

Running pytest with -m "not dev_mode" do not fixes the issue. Just tested 3.9.0. Here is updated output

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' -q -p no:randomly -m 'not dev_mode' --ignore tests/autobahn/test_autobahn.py --ignore tests/test_proxy_functional.py ============================= test session starts ============================== platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.0 configfile: setup.cfg testpaths: tests/ plugins: cov-4.1.0, mock-3.12.0 collected 2664 items / 3 deselected / 2661 selected tests/test_base_protocol.py .................... [ 0%] tests/test_circular_imports.py ......................................... [ 2%] .... [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 3%] tests/test_client_fingerprint.py ............ [ 4%] tests/test_client_functional.py .......................xxx.............. [ 5%] ........................................................................ [ 8%] ..x.....................xxx.......x.............x...................x [ 11%] tests/test_client_proto.py ........... [ 11%] tests/test_client_request.py ........................................... [ 13%] ........................................................................ [ 15%] ............x......... [ 16%] tests/test_client_response.py .......................................... [ 18%] .............. [ 18%] tests/test_client_session.py ..........................................s [ 20%] ...FF...... [ 20%] tests/test_client_ws.py ........................... [ 21%] tests/test_client_ws_functional.py ................................ [ 23%] tests/test_connector.py ....x........................................... [ 24%] .........................................................sss..xxxxxx..s. [ 27%] ............ [ 28%] tests/test_cookiejar.py ......................F.F.............FF...... [ 29%] tests/test_flowcontrol_streams.py ............. [ 30%] tests/test_formdata.py .......... [ 30%] tests/test_helpers.py .................................................. [ 32%] ............................................................ [ 34%] tests/test_http_exceptions.py ................... [ 35%] tests/test_http_parser.py F.FF............s............................. [ 37%] ..................................................................s..... [ 39%] .................... [ 40%] tests/test_http_writer.py ..................... [ 41%] tests/test_imports.py ... [ 41%] tests/test_locks.py ... [ 41%] tests/test_loop.py ..... [ 41%] tests/test_multipart.py ................................................ [ 43%] ......................................................... [ 45%] tests/test_multipart_helpers.py ...............s........................ [ 47%] .........................ss......ss............................ [ 49%] tests/test_payload.py .............. [ 50%] tests/test_proxy.py ................. [ 50%] tests/test_pytest_plugin.py .... [ 51%] tests/test_resolver.py .................... [ 51%] tests/test_route_def.py ...................... [ 52%] tests/test_run_app.py .................................................. [ 54%] ..... [ 54%] tests/test_streams.py .................................................. [ 56%] .............................................................. [ 58%] tests/test_tcp_helpers.py ...... [ 59%] tests/test_test_utils.py ............................................... [ 60%] . [ 60%] tests/test_tracing.py ................... [ 61%] tests/test_urldispatch.py .............................................. [ 63%] ........................................................................ [ 66%] ...................... [ 66%] tests/test_web_app.py ............................s........... [ 68%] tests/test_web_cli.py .......... [ 68%] tests/test_web_exceptions.py ...................... [ 69%] tests/test_web_functional.py ............................x.............. [ 71%] ...............................................................s........ [ 73%] ..... [ 74%] tests/test_web_log.py ........... [ 74%] tests/test_web_middleware.py ........................................... [ 76%] ........................................................................ [ 78%] [ 78%] tests/test_web_request.py .............................................. [ 80%] .......................................................... [ 82%] tests/test_web_request_handler.py .... [ 82%] tests/test_web_response.py ............................................. [ 84%] ........................................................................ [ 87%] .......................... [ 88%] tests/test_web_runner.py ..........ss...... [ 88%] tests/test_web_sendfile.py ..... [ 89%] tests/test_web_sendfile_functional.py .................................. [ 90%] ..............x..................................... [ 92%] tests/test_web_server.py .F......... [ 92%] tests/test_web_urldispatcher.py ...........................xxx [ 93%] tests/test_web_websocket.py ............................................ [ 95%] ... [ 95%] tests/test_web_websocket_functional.py ......................... [ 96%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py .............................s.s......... [ 98%] . [ 98%] tests/test_websocket_writer.py ........FF. [ 99%] tests/test_worker.py ..............xxx [100%] =================================== FAILURES =================================== _______________________ test_client_session_timeout_zero _______________________ self = req = traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await asyncio.shield(host_resolved) client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] aiohttp/connector.py:1169: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiohttp/connector.py:880: in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] aiohttp/resolver.py:33: in resolve infos = await self._loop.getaddrinfo( family = 0 hostname = 'example.com' port = 80 self = /usr/lib64/python3.8/asyncio/base_events.py:825: in getaddrinfo return await self.run_in_executor( family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.8/concurrent/futures/thread.py:57: in run result = self.fn(*self.args, **self.kwargs) self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.8/socket.py:918: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) tests/test_client_session.py:827: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ aiohttp/client.py:574: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'GET' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) redirects = 0 req = self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = None ssl_context = None str_or_url = 'http://example.com' timeout = <_SENTINEL.sentinel: 1> timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) aiohttp/connector.py:540: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] aiohttp/connector.py:907: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = req = traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] aiohttp/connector.py:1183: ClientConnectorError ______________________ test_requote_redirect_url_default _______________________ cls = func = . at 0x7f725856df70> when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.03685799892991781 excinfo = \n') tblen=7> func = . at 0x7f725856df70> precise_start = 1373620.315434841 precise_stop = 1373620.35229284 reraise = (, ) result = None start = 1700979946.0056472 stop = 1700979946.0425067 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f725c588880> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.0/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f72583a12b0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ________________________ TestCookieJarSafe.test_expires ________________________ self = @unittest.skipIf( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) def test_expires(self) -> None: ts_before = datetime.datetime( 1975, 1, 1, tzinfo=datetime.timezone.utc ).timestamp() ts_after = datetime.datetime( 2030, 1, 1, tzinfo=datetime.timezone.utc ).timestamp() > cookies_sent = self.timed_request( "http://expirestest.com/", ts_before, ts_before ) self = ts_after = 1893456000.0 ts_before = 157766400.0 tests/test_cookiejar.py:623: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = url = 'http://expirestest.com/' update_time = datetime.datetime(1975, 1, 1, 0, 0) send_time = datetime.datetime(1975, 1, 1, 0, 0) def timed_request(self, url, update_time, send_time): if isinstance(update_time, int): update_time = datetime.timedelta(seconds=update_time) elif isinstance(update_time, float): update_time = datetime.datetime.fromtimestamp(update_time) if isinstance(send_time, int): send_time = datetime.timedelta(seconds=send_time) elif isinstance(send_time, float): send_time = datetime.datetime.fromtimestamp(send_time) > with travel(update_time, tick=False): E TypeError: 'NoneType' object is not callable self = send_time = datetime.datetime(1975, 1, 1, 0, 0) update_time = datetime.datetime(1975, 1, 1, 0, 0) url = 'http://expirestest.com/' tests/test_cookiejar.py:415: TypeError ________________________ TestCookieJarSafe.test_max_age ________________________ self = @unittest.skipIf( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) def test_max_age(self) -> None: > cookies_sent = self.timed_request("http://maxagetest.com/", 1000, 1000) self = tests/test_cookiejar.py:640: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = url = 'http://maxagetest.com/', update_time = datetime.timedelta(seconds=1000) send_time = datetime.timedelta(seconds=1000) def timed_request(self, url, update_time, send_time): if isinstance(update_time, int): update_time = datetime.timedelta(seconds=update_time) elif isinstance(update_time, float): update_time = datetime.datetime.fromtimestamp(update_time) if isinstance(send_time, int): send_time = datetime.timedelta(seconds=send_time) elif isinstance(send_time, float): send_time = datetime.datetime.fromtimestamp(send_time) > with travel(update_time, tick=False): E TypeError: 'NoneType' object is not callable self = send_time = datetime.timedelta(seconds=1000) update_time = datetime.timedelta(seconds=1000) url = 'http://maxagetest.com/' tests/test_cookiejar.py:415: TypeError ________________________ test_cookie_jar_clear_expired _________________________ @pytest.mark.skipif( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) async def test_cookie_jar_clear_expired(): sut = CookieJar() cookie = SimpleCookie() cookie["foo"] = "bar" cookie["foo"]["expires"] = "Tue, 1 Jan 1990 12:00:00 GMT" > with travel("1980-01-01", tick=False): E TypeError: 'NoneType' object is not callable cookie = sut = tests/test_cookiejar.py:798: TypeError _________________________ test_cookie_jar_clear_domain _________________________ cls = func = . at 0x7f72594460d0> when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.031067402102053165 excinfo = \n') tblen=7> func = . at 0x7f72594460d0> precise_start = 1373628.481313869 precise_stop = 1373628.512381271 reraise = (, ) result = None start = 1700979954.1715262 stop = 1700979954.2025948 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f725c588880> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.0/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f72594ce700> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning _____________________________ test_c_parser_loaded _____________________________ @pytest.mark.skipif(NO_EXTENSIONS, reason="Extensions available but not imported") def test_c_parser_loaded(): > assert "HttpRequestParserC" in dir(aiohttp.http_parser) E AssertionError: assert 'HttpRequestParserC' in ['ASCIISET', 'Any', 'BadHttpMessage', 'BadStatusLine', 'BaseProtocol', 'BaseTimerContext', ...] E + where ['ASCIISET', 'Any', 'BadHttpMessage', 'BadStatusLine', 'BaseProtocol', 'BaseTimerContext', ...] = dir() E + where = aiohttp.http_parser tests/test_http_parser.py:102: AssertionError ________________________ test_invalid_character[pyloop] ________________________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = request = > @pytest.mark.skipif(NO_EXTENSIONS, reason="Only tests C parser.") def test_invalid_character(loop: Any, protocol: Any, request: Any) -> None: > parser = HttpRequestParserC( protocol, loop, 2**16, max_line_size=8190, max_field_size=8190, ) E NameError: name 'HttpRequestParserC' is not defined loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = request = > tests/test_http_parser.py:128: NameError ________________________ test_invalid_linebreak[pyloop] ________________________ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = request = > @pytest.mark.skipif(NO_EXTENSIONS, reason="Only tests C parser.") def test_invalid_linebreak(loop: Any, protocol: Any, request: Any) -> None: > parser = HttpRequestParserC( protocol, loop, 2**16, max_line_size=8190, max_field_size=8190, ) E NameError: name 'HttpRequestParserC' is not defined loop = <_UnixSelectorEventLoop running=False closed=False debug=False> protocol = request = > tests/test_http_parser.py:148: NameError _______________________ test_unsupported_upgrade[pyloop] _______________________ [XPASS(strict)] The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 ___________________________ test_send_compress_text ____________________________ self = args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {} expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) actual = call(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7f7258069550> cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher((args, kwargs)) actual = self._call_matcher(self.call_args) if expected != actual: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7f7258069550> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) kwargs = {} self = /usr/lib64/python3.8/unittest/mock.py:913: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:88: AssertionError ______________________ test_send_compress_text_notakeover ______________________ cls = func = . at 0x7f7258069160> when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.04667534283362329 excinfo = \n') tblen=7> func = . at 0x7f7258069160> precise_start = 1373711.050154918 precise_stop = 1373711.096830261 reraise = (, ) result = None start = 1700980036.7403672 stop = 1700980036.787044 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f725c588880> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.0/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f72537753d0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ---------- coverage: platform linux, python 3.8.18-final-0 ----------- Name Stmts Miss Cover ------------------------------------------------------------ aiohttp/__init__.py 27 3 89% aiohttp/abc.py 90 0 100% aiohttp/base_protocol.py 66 0 100% aiohttp/client.py 491 29 94% aiohttp/client_exceptions.py 135 2 99% aiohttp/client_proto.py 149 3 98% aiohttp/client_reqrep.py 676 8 99% aiohttp/client_ws.py 210 10 95% aiohttp/compression_utils.py 68 7 90% aiohttp/connector.py 713 51 93% aiohttp/cookiejar.py 259 6 98% aiohttp/formdata.py 93 0 100% aiohttp/hdrs.py 90 0 100% aiohttp/helpers.py 519 22 96% aiohttp/http.py 11 0 100% aiohttp/http_exceptions.py 50 0 100% aiohttp/http_parser.py 497 10 98% aiohttp/http_websocket.py 386 7 98% aiohttp/http_writer.py 118 3 97% aiohttp/locks.py 24 0 100% aiohttp/log.py 7 0 100% aiohttp/multipart.py 562 9 98% aiohttp/payload.py 219 5 98% aiohttp/payload_streamer.py 29 0 100% aiohttp/pytest_plugin.py 167 11 93% aiohttp/resolver.py 68 2 97% aiohttp/streams.py 396 4 99% aiohttp/tcp_helpers.py 19 0 100% aiohttp/test_utils.py 313 3 99% aiohttp/tracing.py 191 0 100% aiohttp/typedefs.py 23 0 100% aiohttp/web.py 135 0 100% aiohttp/web_app.py 302 8 97% aiohttp/web_exceptions.py 157 0 100% aiohttp/web_fileresponse.py 141 0 100% aiohttp/web_log.py 102 0 100% aiohttp/web_middlewares.py 55 0 100% aiohttp/web_protocol.py 343 26 92% aiohttp/web_request.py 435 7 98% aiohttp/web_response.py 483 6 99% aiohttp/web_routedef.py 106 2 98% aiohttp/web_runner.py 215 17 92% aiohttp/web_server.py 41 0 100% aiohttp/web_urldispatcher.py 708 13 98% aiohttp/web_ws.py 327 21 94% aiohttp/worker.py 126 19 85% tests/__init__.py 0 0 100% tests/conftest.py 105 30 71% tests/test_base_protocol.py 198 0 100% tests/test_circular_imports.py 31 2 94% tests/test_classbasedview.py 39 2 95% tests/test_client_connection.py 94 0 100% tests/test_client_exceptions.py 183 0 100% tests/test_client_fingerprint.py 59 0 100% tests/test_client_functional.py 2307 121 95% tests/test_client_proto.py 99 0 100% tests/test_client_request.py 787 6 99% tests/test_client_response.py 464 5 99% tests/test_client_session.py 482 8 98% tests/test_client_ws.py 415 0 100% tests/test_client_ws_functional.py 605 18 97% tests/test_connector.py 1520 91 94% tests/test_cookiejar.py 356 15 96% tests/test_flowcontrol_streams.py 100 0 100% tests/test_formdata.py 72 0 100% tests/test_helpers.py 464 15 97% tests/test_http_exceptions.py 109 0 100% tests/test_http_parser.py 957 41 96% tests/test_http_writer.py 182 0 100% tests/test_imports.py 31 1 97% tests/test_locks.py 39 1 97% tests/test_loop.py 36 2 94% tests/test_multipart.py 747 0 100% tests/test_multipart_helpers.py 446 19 96% tests/test_payload.py 94 5 95% tests/test_proxy.py 285 0 100% tests/test_proxy_functional.py 473 473 0% tests/test_pytest_plugin.py 27 0 100% tests/test_resolver.py 176 12 93% tests/test_route_def.py 210 20 90% tests/test_run_app.py 522 10 98% tests/test_streams.py 1077 1 99% tests/test_tcp_helpers.py 52 2 96% tests/test_test_utils.py 242 5 98% tests/test_tracing.py 48 0 100% tests/test_urldispatch.py 844 12 99% tests/test_web_app.py 454 6 99% tests/test_web_cli.py 75 0 100% tests/test_web_exceptions.py 176 0 100% tests/test_web_functional.py 1547 34 98% tests/test_web_log.py 116 2 98% tests/test_web_middleware.py 266 3 99% tests/test_web_request.py 490 0 100% tests/test_web_request_handler.py 40 1 98% tests/test_web_response.py 863 3 99% tests/test_web_runner.py 146 9 94% tests/test_web_sendfile.py 76 0 100% tests/test_web_sendfile_functional.py 634 21 97% tests/test_web_server.py 160 1 99% tests/test_web_urldispatcher.py 306 5 98% tests/test_web_websocket.py 313 2 99% tests/test_web_websocket_functional.py 542 47 91% tests/test_websocket_handshake.py 152 0 100% tests/test_websocket_parser.py 300 15 95% tests/test_websocket_writer.py 68 0 100% tests/test_worker.py 193 28 85% ------------------------------------------------------------ TOTAL 32236 1408 96% ============================= slowest 10 durations ============================= 10.02s call tests/test_run_app.py::TestShutdown::test_shutdown_new_conn_rejected 4.02s call tests/test_run_app.py::TestShutdown::test_shutdown_pending_handler_responds 3.02s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_spawned_task 3.01s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_task 2.02s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_task 2.02s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_not_reached 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.01s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.07s call tests/test_imports.py::test_import_time 1.03s call tests/test_run_app.py::TestShutdown::test_shutdown_close_websockets =========================== short test summary info ============================ SKIPPED [1] tests/test_client_session.py:781: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1966: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1974: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1985: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2163: Proactor Event loop present only in Windows SKIPPED [1] tests/test_http_parser.py:234: C based HTTP parser not available SKIPPED [1] tests/test_http_parser.py:1262: C based HTTP parser not available SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_web_app.py:365: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_functional.py:2126: C based HTTP parser not available SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows SKIPPED [1] tests/test_websocket_parser.py:395: Requires Cython SKIPPED [1] tests/test_websocket_parser.py:410: Requires Cython XFAIL tests/test_client_functional.py::test_ssl_client[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_ok[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_fail[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-entirely different hosts] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-http -> https] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-https -> http] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_aiohttp_request_ctx_manager_close_sess_on_error[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_error_in_performing_request[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_rejected_upload[pyloop] - #7599 XFAIL tests/test_client_request.py::test_verify_ssl_false_with_ssl_context[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_connector.py::test_tcp_connector_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-ip address] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-domain name] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-fully-qualified domain name] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-fully-qualified domain name with multiple trailing dots] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-idna fully-qualified domain name] - reason: trustme is not supported XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_sendfile_functional.py::test_static_file_ssl[pyloop] - reason: trustme is not supported XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_worker.py::test__create_ssl_context_without_certs_and_ciphers[AsyncioWorker-pyloop] - reason: trustme is not supported XFAIL tests/test_worker.py::test__create_ssl_context_with_ciphers[AsyncioWorker-pyloop] - reason: trustme is not supported XFAIL tests/test_worker.py::test__create_ssl_context_with_ca_certs[AsyncioWorker-pyloop] - reason: trustme is not supported FAILED tests/test_client_session.py::test_client_session_timeout_zero - aioht... FAILED tests/test_client_session.py::test_requote_redirect_url_default - pyte... FAILED tests/test_cookiejar.py::TestCookieJarSafe::test_expires - TypeError: ... FAILED tests/test_cookiejar.py::TestCookieJarSafe::test_max_age - TypeError: ... FAILED tests/test_cookiejar.py::test_cookie_jar_clear_expired - TypeError: 'N... FAILED tests/test_cookiejar.py::test_cookie_jar_clear_domain - pytest.PytestU... FAILED tests/test_http_parser.py::test_c_parser_loaded - AssertionError: asse... FAILED tests/test_http_parser.py::test_invalid_character[pyloop] - NameError:... FAILED tests/test_http_parser.py::test_invalid_linebreak[pyloop] - NameError:... FAILED tests/test_web_server.py::test_unsupported_upgrade[pyloop] FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionErr... FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - p... = 12 failed, 2605 passed, 18 skipped, 3 deselected, 26 xfailed in 141.80s (0:02:21) = ```
Dreamsorcerer commented 11 months ago

The strict tests are no longer running, so that part atleast has been fixed.

For the others:

  • test_client_session_timeout_zero: I think I've seen this skipped in a downstream package due to it needing internet access. We should probably fix that to work without.
  • test_requote_redirect_url_default: Probably unclosed socket from previous test failing.
  • test_expires/test_max_age/test_cookie_jar_clear_expired: You've not installed time-machine (I think requirements/ will be included in sdist in 3.9.1, so you should install/check requirements/test.txt in future).
  • test_send_compress_text: Not entirely sure, but maybe this is caused by a regression in 3.9.0 (with a low chance of it happening as a race condition). Should have 3.9.1 pushed shortly, so retest with that.
  • test_cookie_jar_clear_domain/test_send_compress_text_notakeover: Unclosed socket could be from the previous test failing, maybe. But, I'm not sure how there can be an unclosed socket, as those tests don't appear to use sockets for anything...
  • test_http_parser.py: It can't find the C extensions. Apparently, this is because of the addition of tests/__init__.py. The file has been removed again for 3.9.1, but could be added again in the future, as it is needed if we want to configure mypy on the tests. When the file is present, it seems to only find the C extensions if the package is installed (the CI runs pip install -e . before running the tests).
kloczek commented 11 months ago

The strict tests are no longer running, so that part atleast has been fixed.

For the others:

  • test_client_session_timeout_zero: I think I've seen this skipped in a downstream package due to it needing internet access. We should probably fix that to work without.

Many other test suites in other modules allows disable units which requires public network akces using network pytest mark.

  • test_requote_redirect_url_default: Probably unclosed socket from previous test failing.

If it is true it means that there are some dependencies between units. It is module with python extension which allows automatically expose such dependencies https://github.com/mrbean-bremen/pytest-find-dependencies/

  • test_expires/test_max_age/test_cookie_jar_clear_expired: You've not installed time-machine (I think requirements/ will be included in sdist in 3.9.1, so you should install/check requirements/test.txt in future).
[tkloczko@pers-jacek aiohttp-3.9.0]$ grep -r time-machine
tests/test_cookiejar.py:        reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305",
tests/test_cookiejar.py:        reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305",
tests/test_cookiejar.py:    reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305",
  • test_send_compress_text: Not entirely sure, but maybe this is caused by a regression in 3.9.0 (with a low chance of it happening as a race condition). Should have 3.9.1 pushed shortly, so retest with that.

If you have any suggestions how can I try to diagnose this please let me know.

  • test_cookie_jar_clear_domain/test_send_compress_text_notakeover: Unclosed socket could be from the previous test failing, maybe. But, I'm not sure how there can be an unclosed socket, as those tests don't appear to use sockets for anything...

As same as second point.

  • test_http_parser.py: It can't find the C extensions. Apparently, this is because of the addition of tests/__init__.py. The file has been removed again for 3.9.1, but could be added again in the future, as it is needed if we want to configure mypy on the tests. When the file is present, it seems to only find the C extensions if the package is installed (the CI runs pip install -e . before running the tests).

C extension has been build and is packed into .whl which on next stage has been unpacked into /home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.0-2.fc35.x86_64/ build output:

```console + /usr/bin/python3 -sBm build -w --no-isolation * Getting build dependencies for wheel... running egg_info writing aiohttp.egg-info/PKG-INFO writing dependency_links to aiohttp.egg-info/dependency_links.txt writing requirements to aiohttp.egg-info/requires.txt writing top-level names to aiohttp.egg-info/top_level.txt reading manifest file 'aiohttp.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' ********************* * Accelerated build * ********************* warning: no files found matching 'aiohttp' anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.pyd' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution warning: no previously-included files matching '*.lib' found anywhere in distribution warning: no previously-included files matching '*.dll' found anywhere in distribution warning: no previously-included files matching '*.a' found anywhere in distribution warning: no previously-included files matching '*.obj' found anywhere in distribution warning: no previously-included files found matching 'aiohttp/*.html' no previously-included directories found matching 'docs/_build' adding license file 'LICENSE.txt' writing manifest file 'aiohttp.egg-info/SOURCES.txt' * Building wheel... running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-38 creating build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/__init__.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/abc.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/base_protocol.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/client.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/client_exceptions.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/client_proto.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/client_reqrep.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/client_ws.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/compression_utils.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/connector.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/cookiejar.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/formdata.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/hdrs.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/helpers.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/http.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/http_exceptions.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/http_parser.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/http_websocket.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/http_writer.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/locks.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/log.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/multipart.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/payload.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/payload_streamer.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/pytest_plugin.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/resolver.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/streams.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/tcp_helpers.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/test_utils.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/tracing.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/typedefs.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_app.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_exceptions.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_fileresponse.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_log.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_middlewares.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_protocol.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_request.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_response.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_routedef.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_runner.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_server.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_urldispatcher.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/web_ws.py -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/worker.py -> build/lib.linux-x86_64-cpython-38/aiohttp running egg_info writing aiohttp.egg-info/PKG-INFO writing dependency_links to aiohttp.egg-info/dependency_links.txt writing requirements to aiohttp.egg-info/requires.txt writing top-level names to aiohttp.egg-info/top_level.txt reading manifest file 'aiohttp.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' ********************* * Accelerated build * ********************* warning: no files found matching 'aiohttp' anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.pyd' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution warning: no previously-included files matching '*.lib' found anywhere in distribution warning: no previously-included files matching '*.dll' found anywhere in distribution warning: no previously-included files matching '*.a' found anywhere in distribution warning: no previously-included files matching '*.obj' found anywhere in distribution warning: no previously-included files found matching 'aiohttp/*.html' no previously-included directories found matching 'docs/_build' adding license file 'LICENSE.txt' writing manifest file 'aiohttp.egg-info/SOURCES.txt' copying aiohttp/_cparser.pxd -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_find_header.pxd -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_headers.pxi -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_helpers.pyi -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_helpers.pyx -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_http_parser.pyx -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_http_writer.pyx -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/_websocket.pyx -> build/lib.linux-x86_64-cpython-38/aiohttp copying aiohttp/py.typed -> build/lib.linux-x86_64-cpython-38/aiohttp creating build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_cparser.pxd.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_find_header.pxd.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_helpers.pyi.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_helpers.pyx.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_http_parser.pyx.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_http_writer.pyx.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/_websocket.pyx.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash copying aiohttp/.hash/hdrs.py.hash -> build/lib.linux-x86_64-cpython-38/aiohttp/.hash running build_ext building 'aiohttp._websocket' extension creating build/temp.linux-x86_64-cpython-38 creating build/temp.linux-x86_64-cpython-38/aiohttp /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -I/usr/include/python3.8 -c aiohttp/_websocket.c -o build/temp.linux-x86_64-cpython-38/aiohttp/_websocket.o /usr/bin/gcc -shared -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-cpython-38/aiohttp/_websocket.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-38/aiohttp/_websocket.cpython-38-x86_64-linux-gnu.so building 'aiohttp._http_parser' extension creating build/temp.linux-x86_64-cpython-38/vendor creating build/temp.linux-x86_64-cpython-38/vendor/llhttp creating build/temp.linux-x86_64-cpython-38/vendor/llhttp/build creating build/temp.linux-x86_64-cpython-38/vendor/llhttp/build/c creating build/temp.linux-x86_64-cpython-38/vendor/llhttp/src creating build/temp.linux-x86_64-cpython-38/vendor/llhttp/src/native /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -DLLHTTP_STRICT_MODE=0 -Ivendor/llhttp/build -I/usr/include/python3.8 -c aiohttp/_find_header.c -o build/temp.linux-x86_64-cpython-38/aiohttp/_find_header.o aiohttp/_find_header.c: In function ‘find_header’: aiohttp/_find_header.c:21:19: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 21 | char *pchar = str; | ^~~ aiohttp/_find_header.c:9867:1: warning: label ‘missing’ defined but not used [-Wunused-label] 9867 | missing: | ^~~~~~~ /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -DLLHTTP_STRICT_MODE=0 -Ivendor/llhttp/build -I/usr/include/python3.8 -c aiohttp/_http_parser.c -o build/temp.linux-x86_64-cpython-38/aiohttp/_http_parser.o aiohttp/_http_parser.c: In function ‘__pyx_f_7aiohttp_12_http_parser_cb_on_header_field’: aiohttp/_http_parser.c:16181:148: warning: passing argument 2 of ‘__pyx_v_pyparser->__pyx_vtab->_on_header_field’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 16181 | __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_header_field(__pyx_v_pyparser, __pyx_v_at, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L3_error) | ^~~~~~~~~~ aiohttp/_http_parser.c:16181:148: note: expected ‘char *’ but argument is of type ‘const char *’ aiohttp/_http_parser.c: In function ‘__pyx_f_7aiohttp_12_http_parser_cb_on_header_value’: aiohttp/_http_parser.c:16470:148: warning: passing argument 2 of ‘__pyx_v_pyparser->__pyx_vtab->_on_header_value’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 16470 | __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_header_value(__pyx_v_pyparser, __pyx_v_at, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L3_error) | ^~~~~~~~~~ aiohttp/_http_parser.c:16470:148: note: expected ‘char *’ but argument is of type ‘const char *’ In function ‘__pyx_pf_7aiohttp_12_http_parser_10HttpParser_6feed_data’, inlined from ‘__pyx_pw_7aiohttp_12_http_parser_10HttpParser_7feed_data’ at aiohttp/_http_parser.c:12558:13: aiohttp/_http_parser.c:12966:17: warning: ‘__pyx_v_nb’ may be used uninitialized [-Wmaybe-uninitialized] 12966 | __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_data, __pyx_v_nb, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ aiohttp/_http_parser.c: In function ‘__pyx_pw_7aiohttp_12_http_parser_10HttpParser_7feed_data’: aiohttp/_http_parser.c:12573:10: note: ‘__pyx_v_nb’ was declared here 12573 | size_t __pyx_v_nb; | ^~~~~~~~~~ /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -DLLHTTP_STRICT_MODE=0 -Ivendor/llhttp/build -I/usr/include/python3.8 -c vendor/llhttp/build/c/llhttp.c -o build/temp.linux-x86_64-cpython-38/vendor/llhttp/build/c/llhttp.o /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -DLLHTTP_STRICT_MODE=0 -Ivendor/llhttp/build -I/usr/include/python3.8 -c vendor/llhttp/src/native/api.c -o build/temp.linux-x86_64-cpython-38/vendor/llhttp/src/native/api.o /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -DLLHTTP_STRICT_MODE=0 -Ivendor/llhttp/build -I/usr/include/python3.8 -c vendor/llhttp/src/native/http.c -o build/temp.linux-x86_64-cpython-38/vendor/llhttp/src/native/http.o /usr/bin/gcc -shared -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-cpython-38/aiohttp/_find_header.o build/temp.linux-x86_64-cpython-38/aiohttp/_http_parser.o build/temp.linux-x86_64-cpython-38/vendor/llhttp/build/c/llhttp.o build/temp.linux-x86_64-cpython-38/vendor/llhttp/src/native/api.o build/temp.linux-x86_64-cpython-38/vendor/llhttp/src/native/http.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-38/aiohttp/_http_parser.cpython-38-x86_64-linux-gnu.so building 'aiohttp._helpers' extension /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -I/usr/include/python3.8 -c aiohttp/_helpers.c -o build/temp.linux-x86_64-cpython-38/aiohttp/_helpers.o /usr/bin/gcc -shared -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-cpython-38/aiohttp/_helpers.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-38/aiohttp/_helpers.cpython-38-x86_64-linux-gnu.so building 'aiohttp._http_writer' extension /usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fno-semantic-interposition -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -I/usr/include/python3.8 -c aiohttp/_http_writer.c -o build/temp.linux-x86_64-cpython-38/aiohttp/_http_writer.o /usr/bin/gcc -shared -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-cpython-38/aiohttp/_http_writer.o -L/usr/lib64 -o build/lib.linux-x86_64-cpython-38/aiohttp/_http_writer.cpython-38-x86_64-linux-gnu.so installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/__init__.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/abc.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/base_protocol.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/client.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/client_exceptions.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/client_proto.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/client_reqrep.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/client_ws.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/compression_utils.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/connector.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/cookiejar.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/formdata.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/hdrs.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/helpers.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/http.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/http_exceptions.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/http_parser.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/http_websocket.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/http_writer.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/locks.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/log.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/multipart.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/payload.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/payload_streamer.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/pytest_plugin.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/resolver.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/streams.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/tcp_helpers.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/test_utils.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/tracing.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/typedefs.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_app.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_exceptions.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_fileresponse.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_log.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_middlewares.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_protocol.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_request.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_response.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_routedef.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_runner.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_server.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_urldispatcher.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/web_ws.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/worker.py -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_cparser.pxd -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_find_header.pxd -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_headers.pxi -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_helpers.pyi -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_helpers.pyx -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_http_parser.pyx -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_http_writer.pyx -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_websocket.pyx -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/py.typed -> build/bdist.linux-x86_64/wheel/aiohttp creating build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_cparser.pxd.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_find_header.pxd.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_helpers.pyi.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_helpers.pyx.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_http_parser.pyx.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_http_writer.pyx.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/_websocket.pyx.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/.hash/hdrs.py.hash -> build/bdist.linux-x86_64/wheel/aiohttp/.hash copying build/lib.linux-x86_64-cpython-38/aiohttp/_websocket.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_http_parser.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_helpers.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/aiohttp copying build/lib.linux-x86_64-cpython-38/aiohttp/_http_writer.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/aiohttp running install_egg_info Copying aiohttp.egg-info to build/bdist.linux-x86_64/wheel/aiohttp-3.9.0-py3.8.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/aiohttp-3.9.0.dist-info/WHEEL creating '/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.0/dist/.tmp-1hgoy6ii/aiohttp-3.9.0-cp38-cp38-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'aiohttp/__init__.py' adding 'aiohttp/_cparser.pxd' adding 'aiohttp/_find_header.pxd' adding 'aiohttp/_headers.pxi' adding 'aiohttp/_helpers.cpython-38-x86_64-linux-gnu.so' <<<<<=== HERE adding 'aiohttp/_helpers.pyi' adding 'aiohttp/_helpers.pyx' adding 'aiohttp/_http_parser.cpython-38-x86_64-linux-gnu.so' adding 'aiohttp/_http_parser.pyx' adding 'aiohttp/_http_writer.cpython-38-x86_64-linux-gnu.so' adding 'aiohttp/_http_writer.pyx' adding 'aiohttp/_websocket.cpython-38-x86_64-linux-gnu.so' adding 'aiohttp/_websocket.pyx' adding 'aiohttp/abc.py' adding 'aiohttp/base_protocol.py' adding 'aiohttp/client.py' adding 'aiohttp/client_exceptions.py' adding 'aiohttp/client_proto.py' adding 'aiohttp/client_reqrep.py' adding 'aiohttp/client_ws.py' adding 'aiohttp/compression_utils.py' adding 'aiohttp/connector.py' adding 'aiohttp/cookiejar.py' adding 'aiohttp/formdata.py' adding 'aiohttp/hdrs.py' adding 'aiohttp/helpers.py' adding 'aiohttp/http.py' adding 'aiohttp/http_exceptions.py' adding 'aiohttp/http_parser.py' adding 'aiohttp/http_websocket.py' adding 'aiohttp/http_writer.py' adding 'aiohttp/locks.py' adding 'aiohttp/log.py' adding 'aiohttp/multipart.py' adding 'aiohttp/payload.py' adding 'aiohttp/payload_streamer.py' adding 'aiohttp/py.typed' adding 'aiohttp/pytest_plugin.py' adding 'aiohttp/resolver.py' adding 'aiohttp/streams.py' adding 'aiohttp/tcp_helpers.py' adding 'aiohttp/test_utils.py' adding 'aiohttp/tracing.py' adding 'aiohttp/typedefs.py' adding 'aiohttp/web.py' adding 'aiohttp/web_app.py' adding 'aiohttp/web_exceptions.py' adding 'aiohttp/web_fileresponse.py' adding 'aiohttp/web_log.py' adding 'aiohttp/web_middlewares.py' adding 'aiohttp/web_protocol.py' adding 'aiohttp/web_request.py' adding 'aiohttp/web_response.py' adding 'aiohttp/web_routedef.py' adding 'aiohttp/web_runner.py' adding 'aiohttp/web_server.py' adding 'aiohttp/web_urldispatcher.py' adding 'aiohttp/web_ws.py' adding 'aiohttp/worker.py' adding 'aiohttp/.hash/_cparser.pxd.hash' adding 'aiohttp/.hash/_find_header.pxd.hash' adding 'aiohttp/.hash/_helpers.pyi.hash' adding 'aiohttp/.hash/_helpers.pyx.hash' adding 'aiohttp/.hash/_http_parser.pyx.hash' adding 'aiohttp/.hash/_http_writer.pyx.hash' adding 'aiohttp/.hash/_websocket.pyx.hash' adding 'aiohttp/.hash/hdrs.py.hash' adding 'aiohttp-3.9.0.dist-info/LICENSE.txt' adding 'aiohttp-3.9.0.dist-info/METADATA' adding 'aiohttp-3.9.0.dist-info/WHEEL' adding 'aiohttp-3.9.0.dist-info/top_level.txt' adding 'aiohttp-3.9.0.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Successfully built aiohttp-3.9.0-cp38-cp38-linux_x86_64.whl ```

BTW: Looking on list of packaged into .whl archive first I think that .pyx and .pyi files should not be listed. Is that correct? 🤔

Dreamsorcerer commented 11 months ago

Many other test suites in other modules allows disable units which requires public network akces using network pytest mark.

I don't think that test should need a network connection. I've opened #7906.

If it is true it means that there are some dependencies between units.

No, it's a known pytest bug. If an error occurs due to garbage collection (in __del__()), which is the case for these unclosed resources, they pretty much always happen in the setup of the next test.

The only thing we can do here, is try and make sure we correctly close all the resources within a test. But, as I said, I've no idea where those Unix sockets are even coming from...

tests/test_cookiejar.py:        reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305",

I'm not sure what your point is here. If you're not using CPython, it should have been skipped. As it was not skipped, I'm assuming you are using CPython, and therefore forgot to install time-machine.

If you have any suggestions how can I try to diagnose this please let me know.

I'd just retest against 3.9 branch at the moment. I think we have the last regression fix merging in now, so I'll prepare a release in the next few hours.

which on next stage has been unpacked into

Yes, as I said, the problem is that it is not installed. I don't know why it makes such a difference to pytest. But, you can either install it, or manually delete tests/__init__.py. Then it should find it correctly...

BTW: Looking on list of packaged into .whl archive first I think that .pyx and .pyi files should not be listed.

.pyi are typing stubs. If you don't include them, then the user would be missing some typing information.

.pyx could probably be removed, I don't think that's needed for a pre-compiled distribusion. If you'd like to make a PR for that, then that'd be great.

kloczek commented 11 months ago

I don't think that test should need a network connection. I've opened #7906.

👍

If it is true it means that there are some dependencies between units.

No, it's a known pytest bug. If an error occurs due to garbage collection (in __del__()), which is the case for these unclosed resources, they pretty much always happen in the setup of the next test.

The only thing we can do here, is try and make sure we correctly close all the resources within a test. But, as I said, I've no idea where those Unix sockets are even coming from...

I'm not sure what your point is here. If you're not using CPython, it should have been skipped. As it was not skipped, I'm assuming you are using CPython, and therefore forgot to install time-machine.

I'm pointing on two things:

  • there is no anything about that module dependencies in whole tree
  • if hjose units are optional and cen be skipped it should be first check is required module installed and if not skipped instead exiting with fail.

If you have any suggestions how can I try to diagnose this please let me know.

I'd just retest against 3.9 branch at the moment. I think we have the last regression fix merging in now, so I'll prepare a release in the next few hours.

Thank you. If you have any commits/PRs which you want me to test before 3.9.1 release I'm ready to help with testing 😄

which on next stage has been unpacked into

Yes, as I said, the problem is that it is not installed. I don't know why it makes such a difference to pytest. But, you can either install it, or manually delete tests/__init__.py. Then it should find it correctly...

BTW: Looking on list of packaged into .whl archive first I think that .pyx and .pyi files should not be listed.

.pyi are typing stubs. If you don't include them, then the user would be missing some typing information.

.pyx could probably be removed, I don't think that's needed for a pre-compiled distribusion. If you'd like to make a PR for that, then that'd be great.

OK I understand👍 I'm not sure about roles of those files. IIRC .pyx files are used by cython to create .c files so this is why I wrote that some of those files probably should not be installed 😄

kloczek commented 11 months ago

In mean time I've started pytest --find-dependencies and with installed pytest-find-dependencies but because number of permutations to test is quite big probably full test will take even few hours 😋

kloczek commented 11 months ago

As some units are failing it is not possible to perform full test however it was possible to find some dependencies

============================== Results ===============================
Run dependency analysis for 2661 tests.
Executed 13365 tests in 65 test runs.
The following tests are always failing and are excluded from the analysis:
  tests/test_http_parser.py::test_c_parser_loaded
  tests/test_client_session.py::test_client_session_timeout_zero
  tests/test_cookiejar.py::test_cookie_jar_clear_expired
  tests/test_http_parser.py::test_invalid_character[pyloop]
  tests/test_http_parser.py::test_invalid_linebreak[pyloop]
  tests/test_websocket_writer.py::test_send_compress_text
  tests/test_web_server.py::test_unsupported_upgrade[pyloop]
  tests/test_cookiejar.py::TestCookieJarSafe::test_expires
  tests/test_cookiejar.py::TestCookieJarSafe::test_max_age
Dependent tests:
  tests/test_cookiejar.py::test_cookie_jar_clear_domain depends on tests/test_cookiejar.py::test_cookie_jar_clear_expired
  tests/test_client_session.py::test_requote_redirect_url_default depends on tests/test_client_session.py::test_client_session_timeout_zero
  tests/test_websocket_writer.py::test_send_compress_text_notakeover depends on tests/test_websocket_writer.py::test_send_compress_text
  tests/test_client_session.py::test_client_session_timeout_argument depends on tests/test_client_session.py::test_client_session_timeout_zero
  tests/test_cookiejar.py::test_cookie_jar_clear_all depends on tests/test_cookiejar.py::test_cookie_jar_clear_expired
  tests/test_websocket_writer.py::test_send_text_masked depends on tests/test_websocket_writer.py::test_send_compress_text

Dependency test FAILED

Will try to run second test with --deselect already failing units.

kloczek commented 11 months ago

Just FTR .. tested 3.9.1and now more units are failing.

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' -q -p no:randomly -m 'not dev_mode' --ignore tests/autobahn/test_autobahn.py --ignore tests/test_proxy_functional.py ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.1 configfile: setup.cfg testpaths: tests/ plugins: find-dependencies-0.5.2, cov-4.1.0, mock-3.12.0 collected 2785 items / 4 deselected / 2781 selected tests/test_base_protocol.py .................... [ 0%] tests/test_circular_imports.py FFFF............................................. [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 3%] tests/test_client_fingerprint.py ............ [ 4%] tests/test_client_functional.py ........................xxx........................................................................................x.....................xxx.......x. [ 9%] ............x....................x [ 10%] tests/test_client_proto.py ........... [ 11%] tests/test_client_request.py ...............................................................................................................................x......... [ 16%] tests/test_client_response.py ........................................................ [ 18%] tests/test_client_session.py ..........................................s...FF...... [ 20%] tests/test_client_ws.py ........................... [ 21%] tests/test_client_ws_functional.py ................................ [ 22%] tests/test_connector.py ....x....................................................................................................sss..xxxxxx..s............. [ 27%] tests/test_cookiejar.py ......................F.F.............FF...... [ 28%] tests/test_flowcontrol_streams.py ............. [ 29%] tests/test_formdata.py .......... [ 29%] tests/test_helpers.py ................................................................................................................. [ 33%] tests/test_http_exceptions.py ................... [ 34%] tests/test_http_parser.py ........................................................................................................................................................... [ 39%] ..............................................................x............................ [ 43%] tests/test_http_writer.py ..................... [ 43%] tests/test_imports.py ..F [ 44%] tests/test_locks.py ... [ 44%] tests/test_loop.py ..... [ 44%] tests/test_multipart.py ......................................................................................................... [ 48%] tests/test_multipart_helpers.py ...............s.................................................ss......ss............................ [ 51%] tests/test_payload.py .............. [ 52%] tests/test_proxy.py ................. [ 52%] tests/test_pytest_plugin.py .... [ 53%] tests/test_resolver.py .................... [ 53%] tests/test_route_def.py ...................... [ 54%] tests/test_run_app.py ....................................................... [ 56%] tests/test_streams.py ................................................................................................................ [ 60%] tests/test_tcp_helpers.py ...... [ 60%] tests/test_test_utils.py ................................................ [ 62%] tests/test_tracing.py ................... [ 63%] tests/test_urldispatch.py ............................................................................................................................................ [ 68%] tests/test_web_app.py ............................s........... [ 69%] tests/test_web_cli.py .......... [ 70%] tests/test_web_exceptions.py ...................... [ 70%] tests/test_web_functional.py ............................x........................................................................................... [ 75%] tests/test_web_log.py ........... [ 75%] tests/test_web_middleware.py ................................................................................................................... [ 79%] tests/test_web_request.py ........................................................................................................ [ 83%] tests/test_web_request_handler.py .... [ 83%] tests/test_web_response.py ............................................................................................................................................... [ 88%] tests/test_web_runner.py ..........ss...... [ 89%] tests/test_web_sendfile.py ..... [ 89%] tests/test_web_sendfile_functional.py ................................................x..................................... [ 92%] tests/test_web_server.py .x......... [ 92%] tests/test_web_urldispatcher.py ...........................xxx [ 94%] tests/test_web_websocket.py ............................................... [ 95%] tests/test_web_websocket_functional.py ......................... [ 96%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py .......................................... [ 98%] tests/test_websocket_writer.py ........FF.... [ 99%] tests/test_worker.py ..............xxx [100%] ========================================================================================= FAILURES ========================================================================================== ____________________________________________________________________________ test_no_warnings[aiohttp._helpers] _____________________________________________________________________________ import_path = 'aiohttp._helpers' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._helpers' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._helpers')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._helpers' __________________________________________________________________________ test_no_warnings[aiohttp._http_parser] ___________________________________________________________________________ import_path = 'aiohttp._http_parser' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_parser' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._http_parser')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_parser' __________________________________________________________________________ test_no_warnings[aiohttp._http_writer] ___________________________________________________________________________ import_path = 'aiohttp._http_writer' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_writer' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._http_writer')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_writer' ___________________________________________________________________________ test_no_warnings[aiohttp._websocket] ____________________________________________________________________________ import_path = 'aiohttp._websocket' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._websocket' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._websocket')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._websocket' _____________________________________________________________________________ test_client_session_timeout_zero ______________________________________________________________________________ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await asyncio.shield(host_resolved) client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1173: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:884: in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/resolver.py:33: in resolve infos = await self._loop.getaddrinfo( family = 0 hostname = 'example.com' port = 80 self = /usr/lib64/python3.8/asyncio/base_events.py:825: in getaddrinfo return await self.run_in_executor( family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.8/concurrent/futures/thread.py:57: in run result = self.fn(*self.args, **self.kwargs) self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = , proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.8/socket.py:918: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) tests/test_client_session.py:827: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/client.py:574: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'GET' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) redirects = 0 req = self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = None ssl_context = None str_or_url = 'http://example.com' timeout = <_SENTINEL.sentinel: 1> timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:544: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:911: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1187: ClientConnectorError _____________________________________________________________________________ test_requote_redirect_url_default _____________________________________________________________________________ cls = , func = . at 0x7f9da09d2f70>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.09272705996409059 excinfo = \n') tblen=7> func = . at 0x7f9da09d2f70> precise_start = 1418942.731587844 precise_stop = 1418942.824314904 reraise = (, ) result = None start = 1701025268.4218 stop = 1701025268.5145297 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f9da3d39bb0> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f9d9b477280> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ______________________________________________________________________________ TestCookieJarSafe.test_expires _______________________________________________________________________________ self = @unittest.skipIf( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) def test_expires(self) -> None: ts_before = datetime.datetime( 1975, 1, 1, tzinfo=datetime.timezone.utc ).timestamp() ts_after = datetime.datetime( 2030, 1, 1, tzinfo=datetime.timezone.utc ).timestamp() > cookies_sent = self.timed_request( "http://expirestest.com/", ts_before, ts_before ) self = ts_after = 1893456000.0 ts_before = 157766400.0 tests/test_cookiejar.py:623: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , url = 'http://expirestest.com/', update_time = datetime.datetime(1975, 1, 1, 0, 0) send_time = datetime.datetime(1975, 1, 1, 0, 0) def timed_request(self, url, update_time, send_time): if isinstance(update_time, int): update_time = datetime.timedelta(seconds=update_time) elif isinstance(update_time, float): update_time = datetime.datetime.fromtimestamp(update_time) if isinstance(send_time, int): send_time = datetime.timedelta(seconds=send_time) elif isinstance(send_time, float): send_time = datetime.datetime.fromtimestamp(send_time) > with travel(update_time, tick=False): E TypeError: 'NoneType' object is not callable self = send_time = datetime.datetime(1975, 1, 1, 0, 0) update_time = datetime.datetime(1975, 1, 1, 0, 0) url = 'http://expirestest.com/' tests/test_cookiejar.py:415: TypeError ______________________________________________________________________________ TestCookieJarSafe.test_max_age _______________________________________________________________________________ self = @unittest.skipIf( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) def test_max_age(self) -> None: > cookies_sent = self.timed_request("http://maxagetest.com/", 1000, 1000) self = tests/test_cookiejar.py:640: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , url = 'http://maxagetest.com/', update_time = datetime.timedelta(seconds=1000) send_time = datetime.timedelta(seconds=1000) def timed_request(self, url, update_time, send_time): if isinstance(update_time, int): update_time = datetime.timedelta(seconds=update_time) elif isinstance(update_time, float): update_time = datetime.datetime.fromtimestamp(update_time) if isinstance(send_time, int): send_time = datetime.timedelta(seconds=send_time) elif isinstance(send_time, float): send_time = datetime.datetime.fromtimestamp(send_time) > with travel(update_time, tick=False): E TypeError: 'NoneType' object is not callable self = send_time = datetime.timedelta(seconds=1000) update_time = datetime.timedelta(seconds=1000) url = 'http://maxagetest.com/' tests/test_cookiejar.py:415: TypeError _______________________________________________________________________________ test_cookie_jar_clear_expired _______________________________________________________________________________ @pytest.mark.skipif( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) async def test_cookie_jar_clear_expired(): sut = CookieJar() cookie = SimpleCookie() cookie["foo"] = "bar" cookie["foo"]["expires"] = "Tue, 1 Jan 1990 12:00:00 GMT" > with travel("1980-01-01", tick=False): E TypeError: 'NoneType' object is not callable cookie = sut = tests/test_cookiejar.py:798: TypeError _______________________________________________________________________________ test_cookie_jar_clear_domain ________________________________________________________________________________ cls = , func = . at 0x7f9da0ccee50>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.13848252384923398 excinfo = \n') tblen=7> func = . at 0x7f9da0ccee50> precise_start = 1418971.551506509 precise_stop = 1418971.689989033 reraise = (, ) result = None start = 1701025297.2417178 stop = 1701025297.3802035 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f9da3d39bb0> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f9d9b5e3640> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning _____________________________________________________________________________________ test_import_time ______________________________________________________________________________________ pytester = @pytest.mark.skipif( not sys.platform.startswith("linux") or platform.python_implementation() == "PyPy", reason="Timing is more reliable on Linux", ) def test_import_time(pytester: pytest.Pytester) -> None: """Check that importing aiohttp doesn't take too long. Obviously, the time may vary on different machines and may need to be adjusted from time to time, but this should provide an early warning if something is added that significantly increases import time. """ root = Path(__file__).parent.parent old_path = os.environ.get("PYTHONPATH") os.environ["PYTHONPATH"] = os.pathsep.join([str(root)] + sys.path) best_time_ms = 1000 cmd = "import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000))" try: for _ in range(3): r = pytester.run(sys.executable, "-We", "-c", cmd) assert not r.stderr.str() runtime_ms = int(r.stdout.str()) if runtime_ms < best_time_ms: best_time_ms = runtime_ms finally: if old_path is None: os.environ.pop("PYTHONPATH") else: os.environ["PYTHONPATH"] = old_path > assert best_time_ms < 200 E assert 438 < 200 _ = 2 best_time_ms = 438 cmd = "import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000))" old_path = '/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib/python3.8/site-packages' pytester = r = root = PosixPath('/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.1') runtime_ms = 438 /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.1/tests/test_imports.py:62: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-51/test_import_time0 1120 running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-51/test_import_time0 866 running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-51/test_import_time0 438 __________________________________________________________________________________ test_send_compress_text __________________________________________________________________________________ self = , args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {}, expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) actual = call(b'\xc1\x04\x02a\x00\x00'), _error_message = ._error_message at 0x7f9d9ae88d30>, cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher((args, kwargs)) actual = self._call_matcher(self.call_args) if expected != actual: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7f9d9ae88d30> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) kwargs = {} self = /usr/lib64/python3.8/unittest/mock.py:913: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:91: AssertionError ____________________________________________________________________________ test_send_compress_text_notakeover _____________________________________________________________________________ cls = , func = . at 0x7f9d9ae88f70>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.1281589011196047 excinfo = \n') tblen=7> func = . at 0x7f9d9ae88f70> precise_start = 1419203.18795557 precise_stop = 1419203.316114471 reraise = (, ) result = None start = 1701025528.8781676 stop = 1701025529.0063295 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>, ...] self = <_pytest.config.PytestPluginManager object at 0x7f9da3d39bb0> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7f9d99c9b8e0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ---------- coverage: platform linux, python 3.8.18-final-0 ----------- Name Stmts Miss Cover ------------------------------------------------------------ aiohttp/__init__.py 27 8 70% aiohttp/abc.py 90 6 93% aiohttp/base_protocol.py 66 51 23% aiohttp/client.py 491 369 25% aiohttp/client_exceptions.py 135 61 55% aiohttp/client_proto.py 149 120 19% aiohttp/client_reqrep.py 680 507 25% aiohttp/client_ws.py 210 168 20% aiohttp/compression_utils.py 70 36 49% aiohttp/connector.py 715 591 17% aiohttp/cookiejar.py 259 205 21% aiohttp/formdata.py 93 76 18% aiohttp/hdrs.py 90 0 100% aiohttp/helpers.py 519 326 37% aiohttp/http.py 11 0 100% aiohttp/http_exceptions.py 50 20 60% aiohttp/http_parser.py 497 402 19% aiohttp/http_websocket.py 388 287 26% aiohttp/http_writer.py 118 82 31% aiohttp/locks.py 24 16 33% aiohttp/log.py 7 0 100% aiohttp/multipart.py 562 455 19% aiohttp/payload.py 219 107 51% aiohttp/payload_streamer.py 29 10 66% aiohttp/pytest_plugin.py 167 124 26% aiohttp/resolver.py 68 48 29% aiohttp/streams.py 396 313 21% aiohttp/tcp_helpers.py 19 11 42% aiohttp/test_utils.py 313 209 33% aiohttp/tracing.py 191 69 64% aiohttp/typedefs.py 23 0 100% aiohttp/web.py 135 46 66% aiohttp/web_app.py 302 125 59% aiohttp/web_exceptions.py 157 25 84% aiohttp/web_fileresponse.py 141 118 16% aiohttp/web_log.py 102 58 43% aiohttp/web_middlewares.py 55 37 33% aiohttp/web_protocol.py 343 283 17% aiohttp/web_request.py 435 285 34% aiohttp/web_response.py 483 370 23% aiohttp/web_routedef.py 106 46 57% aiohttp/web_runner.py 215 93 57% aiohttp/web_server.py 41 11 73% aiohttp/web_urldispatcher.py 708 446 37% aiohttp/web_ws.py 327 262 20% aiohttp/worker.py 126 93 26% tests/conftest.py 105 30 71% tests/test_base_protocol.py 198 0 100% tests/test_circular_imports.py 31 1 97% tests/test_classbasedview.py 39 2 95% tests/test_client_connection.py 94 0 100% tests/test_client_exceptions.py 183 0 100% tests/test_client_fingerprint.py 59 0 100% tests/test_client_functional.py 2340 121 95% tests/test_client_proto.py 99 0 100% tests/test_client_request.py 787 6 99% tests/test_client_response.py 464 5 99% tests/test_client_session.py 482 8 98% tests/test_client_ws.py 415 0 100% tests/test_client_ws_functional.py 606 18 97% tests/test_connector.py 1520 91 94% tests/test_cookiejar.py 356 15 96% tests/test_flowcontrol_streams.py 100 0 100% tests/test_formdata.py 72 0 100% tests/test_helpers.py 464 13 97% tests/test_http_exceptions.py 109 0 100% tests/test_http_parser.py 963 19 98% tests/test_http_writer.py 182 0 100% tests/test_imports.py 31 1 97% tests/test_locks.py 39 1 97% tests/test_loop.py 36 2 94% tests/test_multipart.py 747 0 100% tests/test_multipart_helpers.py 446 19 96% tests/test_payload.py 94 5 95% tests/test_proxy.py 285 0 100% tests/test_proxy_functional.py 468 468 0% tests/test_pytest_plugin.py 27 0 100% tests/test_resolver.py 176 12 93% tests/test_route_def.py 210 20 90% tests/test_run_app.py 522 10 98% tests/test_streams.py 1077 1 99% tests/test_tcp_helpers.py 52 2 96% tests/test_test_utils.py 242 5 98% tests/test_tracing.py 48 0 100% tests/test_urldispatch.py 844 12 99% tests/test_web_app.py 454 6 99% tests/test_web_cli.py 75 0 100% tests/test_web_exceptions.py 176 0 100% tests/test_web_functional.py 1547 29 98% tests/test_web_log.py 116 2 98% tests/test_web_middleware.py 266 3 99% tests/test_web_request.py 490 0 100% tests/test_web_request_handler.py 40 1 98% tests/test_web_response.py 863 3 99% tests/test_web_runner.py 146 9 94% tests/test_web_sendfile.py 76 0 100% tests/test_web_sendfile_functional.py 634 21 97% tests/test_web_server.py 163 4 98% tests/test_web_urldispatcher.py 306 5 98% tests/test_web_websocket.py 313 2 99% tests/test_web_websocket_functional.py 542 47 91% tests/test_websocket_handshake.py 152 0 100% tests/test_websocket_parser.py 300 9 97% tests/test_websocket_writer.py 95 0 100% tests/test_worker.py 193 28 85% ------------------------------------------------------------ TOTAL 32311 8031 75% =================================================================================== slowest 10 durations ==================================================================================== 10.04s call tests/test_run_app.py::TestShutdown::test_shutdown_new_conn_rejected 4.39s call tests/test_imports.py::test_import_time 4.08s call tests/test_run_app.py::TestShutdown::test_shutdown_pending_handler_responds 3.06s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_spawned_task 3.02s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_task 2.15s call tests/test_run_app.py::test_sigint 2.04s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_not_reached 2.03s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_task 2.01s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] ================================================================================== short test summary info ================================================================================== SKIPPED [1] tests/test_client_session.py:781: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1966: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1974: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1985: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2163: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_web_app.py:365: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_ssl_client[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_ok[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_tcp_connector_fingerprint_fail[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-entirely different hosts] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-http -> https] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_drop_auth_on_redirect_to_other_host[pyloop-https -> http] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_aiohttp_request_ctx_manager_close_sess_on_error[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_error_in_performing_request[pyloop] - reason: trustme is not supported XFAIL tests/test_client_functional.py::test_rejected_upload[pyloop] - #7599 XFAIL tests/test_client_request.py::test_verify_ssl_false_with_ssl_context[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_connector.py::test_tcp_connector_raise_connector_ssl_error[pyloop] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-ip address] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-domain name] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-fully-qualified domain name] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-fully-qualified domain name with multiple trailing dots] - reason: trustme is not supported XFAIL tests/test_connector.py::test_tcp_connector_do_not_raise_connector_ssl_error[pyloop-idna fully-qualified domain name] - reason: trustme is not supported XFAIL tests/test_http_parser.py::test_parse_uri_utf8[c-parser-pyloop] - reason: Not valid HTTP. Maybe update py-parser to reject later. XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_sendfile_functional.py::test_static_file_ssl[pyloop] - reason: trustme is not supported XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_worker.py::test__create_ssl_context_without_certs_and_ciphers[AsyncioWorker-pyloop] - reason: trustme is not supported XFAIL tests/test_worker.py::test__create_ssl_context_with_ciphers[AsyncioWorker-pyloop] - reason: trustme is not supported XFAIL tests/test_worker.py::test__create_ssl_context_with_ca_certs[AsyncioWorker-pyloop] - reason: trustme is not supported FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._helpers] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_parser] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_writer] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._websocket] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_client_session.py::test_client_session_timeout_zero - aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] FAILED tests/test_client_session.py::test_requote_redirect_url_default - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_cookiejar.py::TestCookieJarSafe::test_expires - TypeError: 'NoneType' object is not callable FAILED tests/test_cookiejar.py::TestCookieJarSafe::test_max_age - TypeError: 'NoneType' object is not callable FAILED tests/test_cookiejar.py::test_cookie_jar_clear_expired - TypeError: 'NoneType' object is not callable FAILED tests/test_cookiejar.py::test_cookie_jar_clear_domain - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_imports.py::test_import_time - assert 438 < 200 FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionError: expected call not found. FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - pytest.PytestUnraisableExceptionWarning: Exception ignored in: ===================================================== 13 failed, 2727 passed, 13 skipped, 4 deselected, 28 xfailed in 403.10s (0:06:43) ===================================================== ```
Dreamsorcerer commented 11 months ago

Well, other than import_time, which is probably just some random thing with your setup that caused it run slowly that time, the only new one is test_circular_imports.py, which appears to be because the C extensions aren't there? I'm pretty sure we didn't touch anything there in 3.9.1...

test_send_compress_text is still failing though. I'm not sure what's going on with that one. Would be great if you can dig into it a little. Maybe @bdraco has some ideas on how that could be failing.

Dreamsorcerer commented 11 months ago

the only new one is test_circular_imports.py, which appears to be because the C extensions aren't there?

We discussed these near the top of the thread actually: https://github.com/aio-libs/aiohttp/issues/7255#issuecomment-1511704934 So, there's no new failures here really.

Dreamsorcerer commented 11 months ago

test_send_compress_text is still failing though. I'm not sure what's going on with that one. Would be great if you can dig into it a little. Maybe @bdraco has some ideas on how that could be failing.

Maybe the compression results are different in your version of zlib? Maybe check what zlib.ZLIB_RUNTIME_VERSION is?

kloczek commented 11 months ago

Well, other than import_time, which is probably just some random thing with your setup that caused it run slowly that time, the only new one is test_circular_imports.py, which appears to be because the C extensions aren't there? I'm pretty sure we didn't touch anything there in 3.9.1...

May you explain what exactly it means and/or how van I try to diagnose that? 🤔

kloczek commented 11 months ago

Maybe the compression results are different in your version of zlib? Maybe check what zlib.ZLIB_RUNTIME_VERSION is?

FYI I'm using zlib-ng.

kloczek commented 11 months ago

The circular_imports tests appear to be failing to import. I'd compare with how our CI runs it (https://github.com/aio-libs/aiohttp/blob/master/.github/workflows/ci.yml#L128), but I suspect you'll need to install the package or tweak PYTHONPATH to get it to work correctly.

Then it looks like there is a DNS error, maybe that test should be mocked or something...

Cannot find what exactly needs to be resolvable here 🤔 So fat on scale of +12k of other build modules literally none had any DNS resolver issue.

kloczek commented 11 months ago

Generally looking on test suite code if it would be anything related to module DSO much more units would be failing 🤔

Dreamsorcerer commented 11 months ago

FYI I'm using zlib-ng.

Well, I think that solves that mystery. Not sure if we can do anything with that test...

So fat on scale of +12k of other build modules literally none had any DNS resolver issue.

Oh, I just assumed you'd disabled internet access. Maybe the problem is something else...

Generally looking on test suite code if it would be anything related to module DSO much more units would be failing 🤔

Yeah, we went over it before. It has something to do with running python in a subprocess. When run in a subprocess, your system is failing to import the modules. Maybe it's similar to the tests/__init__.py issue, and only works when the package is installed? If you can figure out how to get it working, and can recommend a change to those tests, we'll take a look.

kloczek commented 11 months ago

FYI I'm using zlib-ng.

Well, I think that solves that mystery. Not sure if we can do anything with that test...

Last issue with zlib-ng was with perl +half year ago. Nothing else on scale 5.6k packages have aby issues. In other words it probability is still non-zero however IMO it is really low. How can I try to diagnose this to remove this cause from the list? 🤔

So fat on scale of +12k of other build modules literally none had any DNS resolver issue.

Oh, I just assumed you'd disabled internet access. Maybe the problem is something else...

Generally looking on test suite code if it would be anything related to module DSO much more units would be failing 🤔

Yeah, we went over it before. It has something to do with running python in a subprocess. When run in a subprocess, your system is failing to import the modules. Maybe it's similar to the tests/__init__.py issue, and only works when the package is installed? If you can figure out how to get it working, and can recommend a change to those tests, we'll take a look.

Correction +1.2k modules

[tkloczko@pers-jacek SPECS]$ ls python-*.spec -1 | wc -l
1213

I'm building in two sets of envs. Final prod builds are in without routing and DNS si available. Copied here pytest result was from staging env where is full public network access.

bdraco commented 11 months ago

I expect zlib_ng works fine as I use it in production https://github.com/bdraco/aiohttp-zlib-ng Its not unexpected that the raw bytes will be different on zlib_ng.

The test should probably be changed to uncompress the result instead of verifying the raw bytes.

Dreamsorcerer commented 11 months ago

The test should probably be changed to uncompress the result instead of verifying the raw bytes.

That's one option. But, we did see a PR recently where the change in exact bytes was a red flag (as the proposed change would reduce compression effectiveness), so would be nice to keep.

kloczek commented 10 months ago

Just FTR ..

Here is pytest output of the new 3.9.1 ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' -p no:randomly -m 'not dev_mode' --ignore tests/autobahn/test_autobahn.py --ignore tests/test_proxy_functional.py ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.1 configfile: setup.cfg testpaths: tests/ plugins: mock-3.12.0, anyio-4.2.0, asyncio-0.23.2 asyncio: mode=strict collected 2785 items / 4 deselected / 2781 selected tests/test_base_protocol.py .................... [ 0%] tests/test_circular_imports.py FFFF............................................. [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 3%] tests/test_client_fingerprint.py ............ [ 4%] tests/test_client_functional.py ...................................................................................................................x................................. [ 9%] .................................x [ 10%] tests/test_client_proto.py ........... [ 11%] tests/test_client_request.py ......................................................................................................................................... [ 16%] tests/test_client_response.py ........................................................ [ 18%] tests/test_client_session.py ..........................................s...FF...... [ 20%] tests/test_client_ws.py ........................... [ 21%] tests/test_client_ws_functional.py ................................ [ 22%] tests/test_connector.py ....x....................................................................................................sss..........s............. [ 27%] tests/test_cookiejar.py ......................F.F.............FF...... [ 28%] tests/test_flowcontrol_streams.py ............. [ 29%] tests/test_formdata.py .......... [ 29%] tests/test_helpers.py ................................................................................................................. [ 33%] tests/test_http_exceptions.py ................... [ 34%] tests/test_http_parser.py ........................................................................................................................................................... [ 39%] ..............................................................x............................ [ 43%] tests/test_http_writer.py ..................... [ 43%] tests/test_imports.py ..F [ 44%] tests/test_locks.py ... [ 44%] tests/test_loop.py ..... [ 44%] tests/test_multipart.py ......................................................................................................... [ 48%] tests/test_multipart_helpers.py ...............s.................................................ss......ss............................ [ 51%] tests/test_payload.py .............. [ 52%] tests/test_proxy.py ................. [ 52%] tests/test_pytest_plugin.py .... [ 53%] tests/test_resolver.py .................... [ 53%] tests/test_route_def.py ...................... [ 54%] tests/test_run_app.py ....................................................... [ 56%] tests/test_streams.py ................................................................................................................ [ 60%] tests/test_tcp_helpers.py ...... [ 60%] tests/test_test_utils.py ................................................ [ 62%] tests/test_tracing.py ................... [ 63%] tests/test_urldispatch.py ............................................................................................................................................ [ 68%] tests/test_web_app.py ............................s........... [ 69%] tests/test_web_cli.py .......... [ 70%] tests/test_web_exceptions.py ...................... [ 70%] tests/test_web_functional.py ............................x........................................................................................... [ 75%] tests/test_web_log.py ........... [ 75%] tests/test_web_middleware.py ................................................................................................................... [ 79%] tests/test_web_request.py ........................................................................................................ [ 83%] tests/test_web_request_handler.py .... [ 83%] tests/test_web_response.py ............................................................................................................................................... [ 88%] tests/test_web_runner.py ..........ss...... [ 89%] tests/test_web_sendfile.py ..... [ 89%] tests/test_web_sendfile_functional.py ...................................................................................... [ 92%] tests/test_web_server.py .x......... [ 92%] tests/test_web_urldispatcher.py ...........................xxx [ 94%] tests/test_web_websocket.py ............................................... [ 95%] tests/test_web_websocket_functional.py ......................... [ 96%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py .......................................... [ 98%] tests/test_websocket_writer.py ........FF.... [ 99%] tests/test_worker.py ................. [100%] ========================================================================================= FAILURES ========================================================================================== ____________________________________________________________________________ test_no_warnings[aiohttp._helpers] _____________________________________________________________________________ import_path = 'aiohttp._helpers' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._helpers' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._helpers')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._helpers' __________________________________________________________________________ test_no_warnings[aiohttp._http_parser] ___________________________________________________________________________ import_path = 'aiohttp._http_parser' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_parser' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._http_parser')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_parser' __________________________________________________________________________ test_no_warnings[aiohttp._http_writer] ___________________________________________________________________________ import_path = 'aiohttp._http_writer' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._http_writer' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._http_writer')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._http_writer' ___________________________________________________________________________ test_no_warnings[aiohttp._websocket] ____________________________________________________________________________ import_path = 'aiohttp._websocket' @pytest.mark.parametrize( "import_path", _mark_aiohttp_worker_for_skipping(_find_all_importables(aiohttp)), ) def test_no_warnings(import_path: str) -> None: """Verify that exploding importables doesn't explode. This is seeking for any import errors including ones caused by circular imports. """ imp_cmd = ( # fmt: off sys.executable, "-W", "error", # The following deprecation warning is triggered by importing # `gunicorn.util`. Hopefully, it'll get fixed in the future. See # https://github.com/benoitc/gunicorn/issues/2840 for detail. "-W", "ignore:module 'sre_constants' is " "deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", # Also caused by `gunicorn.util` importing `pkg_resources`: "-W", "ignore:Creating a LegacyVersion has been deprecated and " "will be removed in the next major release:" "DeprecationWarning:", # Deprecation warning emitted by setuptools v67.5.0+ triggered by importing # `gunicorn.util`. "-W", "ignore:pkg_resources is deprecated as an API:" "DeprecationWarning", "-c", f"import {import_path!s}", # fmt: on ) > subprocess.check_call(imp_cmd) imp_cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) import_path = 'aiohttp._websocket' tests/test_circular_imports.py:115: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),), kwargs = {} retcode = 1, cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) def check_call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) """ retcode = call(*popenargs, **kwargs) if retcode: cmd = kwargs.get("args") if cmd is None: cmd = popenargs[0] > raise CalledProcessError(retcode, cmd) E subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', 'ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning:', '-W', 'ignore:pkg_resources is deprecated as an API:DeprecationWarning', '-c', 'import aiohttp._websocket')' returned non-zero exit status 1. cmd = ('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...) kwargs = {} popenargs = (('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W', ...),) retcode = 1 /usr/lib64/python3.8/subprocess.py:364: CalledProcessError ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aiohttp._websocket' _____________________________________________________________________________ test_client_session_timeout_zero ______________________________________________________________________________ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await asyncio.shield(host_resolved) client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1173: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:884: in _resolve_host addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/resolver.py:33: in resolve infos = await self._loop.getaddrinfo( family = 0 hostname = 'example.com' port = 80 self = /usr/lib64/python3.8/asyncio/base_events.py:825: in getaddrinfo return await self.run_in_executor( family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.8/concurrent/futures/thread.py:57: in run result = self.fn(*self.args, **self.kwargs) self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = , proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.8/socket.py:918: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) tests/test_client_session.py:827: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/client.py:574: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'GET' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) redirects = 0 req = self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = None ssl_context = None str_or_url = 'http://example.com' timeout = <_SENTINEL.sentinel: 1> timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:544: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:911: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None host_resolved = asyncio.ensure_future( self._resolve_host(host, port, traces=traces), loop=self._loop ) try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await asyncio.shield(host_resolved) except asyncio.CancelledError: def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: with suppress(Exception, asyncio.CancelledError): fut.result() host_resolved.add_done_callback(drop_exception) raise except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' host_resolved = exception=gaierror(-2, 'Name or service not known')> port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/connector.py:1187: ClientConnectorError _____________________________________________________________________________ test_requote_redirect_url_default _____________________________________________________________________________ cls = , func = . at 0x7fae6def3b80>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.04011362500023097 excinfo = \n') tblen=7> func = . at 0x7fae6def3b80> precise_start = 531043.826729158 precise_stop = 531043.866842783 reraise = (, ) result = None start = 1703490076.386227 stop = 1703490076.4263418 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>] self = <_pytest.config.PytestPluginManager object at 0x7fae723e1970> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fae6df20af0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning ______________________________________________________________________________ TestCookieJarSafe.test_expires _______________________________________________________________________________ self = @unittest.skipIf( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) def test_expires(self) -> None: ts_before = datetime.datetime( 1975, 1, 1, tzinfo=datetime.timezone.utc ).timestamp() ts_after = datetime.datetime( 2030, 1, 1, tzinfo=datetime.timezone.utc ).timestamp() > cookies_sent = self.timed_request( "http://expirestest.com/", ts_before, ts_before ) self = ts_after = 1893456000.0 ts_before = 157766400.0 tests/test_cookiejar.py:623: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , url = 'http://expirestest.com/', update_time = datetime.datetime(1975, 1, 1, 0, 0) send_time = datetime.datetime(1975, 1, 1, 0, 0) def timed_request(self, url, update_time, send_time): if isinstance(update_time, int): update_time = datetime.timedelta(seconds=update_time) elif isinstance(update_time, float): update_time = datetime.datetime.fromtimestamp(update_time) if isinstance(send_time, int): send_time = datetime.timedelta(seconds=send_time) elif isinstance(send_time, float): send_time = datetime.datetime.fromtimestamp(send_time) > with travel(update_time, tick=False): E TypeError: 'NoneType' object is not callable self = send_time = datetime.datetime(1975, 1, 1, 0, 0) update_time = datetime.datetime(1975, 1, 1, 0, 0) url = 'http://expirestest.com/' tests/test_cookiejar.py:415: TypeError ______________________________________________________________________________ TestCookieJarSafe.test_max_age _______________________________________________________________________________ self = @unittest.skipIf( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) def test_max_age(self) -> None: > cookies_sent = self.timed_request("http://maxagetest.com/", 1000, 1000) self = tests/test_cookiejar.py:640: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , url = 'http://maxagetest.com/', update_time = datetime.timedelta(seconds=1000) send_time = datetime.timedelta(seconds=1000) def timed_request(self, url, update_time, send_time): if isinstance(update_time, int): update_time = datetime.timedelta(seconds=update_time) elif isinstance(update_time, float): update_time = datetime.datetime.fromtimestamp(update_time) if isinstance(send_time, int): send_time = datetime.timedelta(seconds=send_time) elif isinstance(send_time, float): send_time = datetime.datetime.fromtimestamp(send_time) > with travel(update_time, tick=False): E TypeError: 'NoneType' object is not callable self = send_time = datetime.timedelta(seconds=1000) update_time = datetime.timedelta(seconds=1000) url = 'http://maxagetest.com/' tests/test_cookiejar.py:415: TypeError _______________________________________________________________________________ test_cookie_jar_clear_expired _______________________________________________________________________________ @pytest.mark.skipif( sys.implementation.name != "cpython", reason="time_machine leverages CPython specific pointers https://github.com/adamchainz/time-machine/issues/305", ) async def test_cookie_jar_clear_expired(): sut = CookieJar() cookie = SimpleCookie() cookie["foo"] = "bar" cookie["foo"]["expires"] = "Tue, 1 Jan 1990 12:00:00 GMT" > with travel("1980-01-01", tick=False): E TypeError: 'NoneType' object is not callable cookie = sut = tests/test_cookiejar.py:798: TypeError _______________________________________________________________________________ test_cookie_jar_clear_domain ________________________________________________________________________________ cls = , func = . at 0x7fae6dd70160>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.03612275992054492 excinfo = \n') tblen=7> func = . at 0x7fae6dd70160> precise_start = 531052.692443724 precise_stop = 531052.728566484 reraise = (, ) result = None start = 1703490085.2519417 stop = 1703490085.288066 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>] self = <_pytest.config.PytestPluginManager object at 0x7fae723e1970> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fae6dd7a370> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning _____________________________________________________________________________________ test_import_time ______________________________________________________________________________________ pytester = @pytest.mark.skipif( not sys.platform.startswith("linux") or platform.python_implementation() == "PyPy", reason="Timing is more reliable on Linux", ) def test_import_time(pytester: pytest.Pytester) -> None: """Check that importing aiohttp doesn't take too long. Obviously, the time may vary on different machines and may need to be adjusted from time to time, but this should provide an early warning if something is added that significantly increases import time. """ root = Path(__file__).parent.parent old_path = os.environ.get("PYTHONPATH") os.environ["PYTHONPATH"] = os.pathsep.join([str(root)] + sys.path) best_time_ms = 1000 cmd = "import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000))" try: for _ in range(3): r = pytester.run(sys.executable, "-We", "-c", cmd) assert not r.stderr.str() runtime_ms = int(r.stdout.str()) if runtime_ms < best_time_ms: best_time_ms = runtime_ms finally: if old_path is None: os.environ.pop("PYTHONPATH") else: os.environ["PYTHONPATH"] = old_path > assert best_time_ms < 200 E assert 201 < 200 _ = 2 best_time_ms = 201 cmd = "import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000))" old_path = '/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib/python3.8/site-packages' pytester = r = root = PosixPath('/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.1') runtime_ms = 201 /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.1/tests/test_imports.py:62: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-24/test_import_time0 213 running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-24/test_import_time0 226 running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-24/test_import_time0 201 __________________________________________________________________________________ test_send_compress_text __________________________________________________________________________________ self = , args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {}, expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) actual = call(b'\xc1\x04\x02a\x00\x00'), _error_message = ._error_message at 0x7fae6ce57dc0>, cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher((args, kwargs)) actual = self._call_matcher(self.call_args) if expected != actual: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7fae6ce57dc0> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = ((b'\xc1\x05*\x01b\x00\x00',), {}) kwargs = {} self = /usr/lib64/python3.8/unittest/mock.py:913: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:91: AssertionError ____________________________________________________________________________ test_send_compress_text_notakeover _____________________________________________________________________________ cls = , func = . at 0x7fae6ce57e50>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.055374627001583576 excinfo = \n') tblen=7> func = . at 0x7fae6ce57e50> precise_start = 531144.965511038 precise_stop = 531145.020885665 reraise = (, ) result = None start = 1703490177.525009 stop = 1703490177.5803847 when = 'call' /usr/lib/python3.8/site-packages/_pytest/runner.py:341: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/_pytest/runner.py:262: in lambda: ihook(item=item, **kwds), when=when, reraise=reraise ihook = item = kwds = {} /usr/lib/python3.8/site-packages/pluggy/_hooks.py:493: in __call__ return self._hookexec(self.name, self._hookimpls, kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.8/site-packages/pluggy/_manager.py:115: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>] self = <_pytest.config.PytestPluginManager object at 0x7fae723e1970> /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: yield if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fae6c5540d0> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning =================================================================================== slowest 10 durations ==================================================================================== 10.02s call tests/test_run_app.py::TestShutdown::test_shutdown_new_conn_rejected 4.02s call tests/test_run_app.py::TestShutdown::test_shutdown_pending_handler_responds 3.02s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_spawned_task 3.01s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_task 2.01s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_task 2.01s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_not_reached 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.00s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.02s call tests/test_run_app.py::TestShutdown::test_shutdown_close_websockets 1.01s call tests/test_run_app.py::TestShutdown::test_shutdown_close_idle_keepalive ================================================================================== short test summary info ================================================================================== SKIPPED [1] tests/test_client_session.py:781: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1966: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1974: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1985: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2163: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_web_app.py:365: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_rejected_upload[pyloop] - #7599 XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_http_parser.py::test_parse_uri_utf8[c-parser-pyloop] - reason: Not valid HTTP. Maybe update py-parser to reject later. XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._helpers] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_parser] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._http_writer] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_circular_imports.py::test_no_warnings[aiohttp._websocket] - subprocess.CalledProcessError: Command '('/usr/bin/python3', '-W', 'error', '-W', "ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing", '-W'... FAILED tests/test_client_session.py::test_client_session_timeout_zero - aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] FAILED tests/test_client_session.py::test_requote_redirect_url_default - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_cookiejar.py::TestCookieJarSafe::test_expires - TypeError: 'NoneType' object is not callable FAILED tests/test_cookiejar.py::TestCookieJarSafe::test_max_age - TypeError: 'NoneType' object is not callable FAILED tests/test_cookiejar.py::test_cookie_jar_clear_expired - TypeError: 'NoneType' object is not callable FAILED tests/test_cookiejar.py::test_cookie_jar_clear_domain - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_imports.py::test_import_time - assert 201 < 200 FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionError: expected call not found. FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - pytest.PytestUnraisableExceptionWarning: Exception ignored in: ===================================================== 13 failed, 2746 passed, 13 skipped, 4 deselected, 9 xfailed in 146.16s (0:02:26) ====================================================== ```
Dreamsorcerer commented 10 months ago

Looks the same. We've reverted the use of time-machine in master, which will get the cookiejar tests back if you're still not going to bother installing that dependency in the meantime.

kloczek commented 7 months ago

BTW testing circular imports .. pylint can be used for that https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/cyclic-import.html

Nevertheless I think that this test should not be parto of the test suite but more likely CI tests. Repeating that kind of test by many distro maintainers can be avoided by check one time the code and add that kind of test as part of the CI of the qualification tests of any commit or PR.

webknjaz commented 7 months ago

I explained somewhere already that those tests are important and correct.

kloczek commented 6 months ago

I explained somewhere already that those tests are important and correct.

Really .. the best would be used for that just pylint and only in CI and not in actual test suite.

Updated pytest output of the 3.9.5 with python 3.10.14 and pytest 8.1.1 with excluded units checking circular imports

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib/python3.10/site-packages + /usr/bin/pytest -ra -m 'not network' -p no:randomly -m 'not dev_mode' --ignore tests/autobahn/test_autobahn.py --deselect 'tests/test_circular_imports.py::test_no_warnings[aiohttp._helpers]' --deselect 'tests/test_circular_imports.py::test_no_warnings[aiohttp._http_parser]' --deselect 'tests/test_circular_imports.py::test_no_warnings[aiohttp._http_writer]' --deselect 'tests/test_circular_imports.py::test_no_warnings[aiohttp._websocket]' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0 rootdir: /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.5 configfile: setup.cfg testpaths: tests/ plugins: mock-3.14.0 collected 3124 items / 10 deselected / 3114 selected tests/test_base_protocol.py .................... [ 0%] tests/test_circular_imports.py ............................................. [ 2%] tests/test_classbasedview.py .... [ 2%] tests/test_client_connection.py ......... [ 2%] tests/test_client_exceptions.py ........................... [ 3%] tests/test_client_fingerprint.py ............ [ 3%] tests/test_client_functional.py .................................................................................................................x................................... [ 8%] ...............................x [ 9%] tests/test_client_proto.py ........... [ 9%] tests/test_client_request.py ......................................................................................................................................... [ 14%] tests/test_client_response.py ........................................................ [ 16%] tests/test_client_session.py ..........................................s..FF........ [ 17%] tests/test_client_ws.py ........................... [ 18%] tests/test_client_ws_functional.py ................................ [ 19%] tests/test_connector.py ....x....................................................................................................sss...........s............. [ 24%] tests/test_cookiejar.py .............................................. [ 25%] tests/test_flowcontrol_streams.py ............. [ 25%] tests/test_formdata.py .......... [ 26%] tests/test_helpers.py ................................................................................................................... [ 29%] tests/test_http_exceptions.py ................... [ 30%] tests/test_http_parser.py ........................................................................xx..............................................................x.................. [ 35%] ...............................................................................x..................................................................................................... [ 41%] ....................................xx.....................................................................................................................................x......... [ 47%] ................... [ 47%] tests/test_http_writer.py ..................... [ 48%] tests/test_imports.py ..F [ 48%] tests/test_locks.py ... [ 48%] tests/test_loop.py ..... [ 48%] tests/test_multipart.py ............................................................................................................. [ 52%] tests/test_multipart_helpers.py ...............s.................................................ss......ss............................ [ 55%] tests/test_payload.py .............. [ 56%] tests/test_proxy.py ................. [ 56%] tests/test_proxy_functional.py ss..........ss........ [ 57%] tests/test_pytest_plugin.py F... [ 57%] tests/test_resolver.py .................... [ 58%] tests/test_route_def.py ...................... [ 58%] tests/test_run_app.py ....................................................... [ 60%] tests/test_streams.py ................................................................................................................ [ 64%] tests/test_tcp_helpers.py ...... [ 64%] tests/test_test_utils.py ................................................ [ 65%] tests/test_tracing.py ................... [ 66%] tests/test_urldispatch.py ............................................................................................................................................. [ 71%] tests/test_web_app.py ............................s........... [ 72%] tests/test_web_cli.py .......... [ 72%] tests/test_web_exceptions.py ...................... [ 73%] tests/test_web_functional.py ...........................x........................................................................................... [ 77%] tests/test_web_log.py ........... [ 77%] tests/test_web_middleware.py ................................................................................................................... [ 81%] tests/test_web_request.py ........................................................................................................ [ 84%] tests/test_web_request_handler.py .... [ 84%] tests/test_web_response.py ............................................................................................................................................... [ 89%] tests/test_web_runner.py ..........ss...... [ 89%] tests/test_web_sendfile.py ..... [ 90%] tests/test_web_sendfile_functional.py .......................................................................................... [ 92%] tests/test_web_server.py .x......... [ 93%] tests/test_web_urldispatcher.py ..................................xxx [ 94%] tests/test_web_websocket.py .................................................... [ 96%] tests/test_web_websocket_functional.py ............................ [ 97%] tests/test_websocket_handshake.py .................... [ 97%] tests/test_websocket_parser.py .......................................... [ 99%] tests/test_websocket_writer.py ........FF.... [ 99%] tests/test_worker.py ................. [100%] ========================================================================================= FAILURES ========================================================================================== _____________________________________________________________________________ test_client_session_timeout_zero ______________________________________________________________________________ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. > hosts = await self._resolve_host(host, port, traces=traces) client_error = fingerprint = None host = 'example.com' port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/connector.py:1203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/connector.py:880: in _resolve_host return await asyncio.shield(resolved_host_task) host = 'example.com' key = ('example.com', 80) port = 80 resolved_host_task = exception=gaierror(-2, 'Name or service not known')> self = traces = [] ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/connector.py:917: in _resolve_host_with_throttle addrs = await self._resolver.resolve(host, port, family=self._family) host = 'example.com' key = ('example.com', 80) port = 80 self = traces = [] ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/resolver.py:33: in resolve infos = await self._loop.getaddrinfo( family = 0 hostname = 'example.com' port = 80 self = /usr/lib64/python3.10/asyncio/base_events.py:863: in getaddrinfo return await self.run_in_executor( family = 0 flags = getaddr_func = host = 'example.com' port = 80 proto = 0 self = <_UnixSelectorEventLoop running=False closed=False debug=False> type = /usr/lib64/python3.10/concurrent/futures/thread.py:58: in run result = self.fn(*self.args, **self.kwargs) self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'example.com', port = 80, family = 0, type = , proto = 0, flags = def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E socket.gaierror: [Errno -2] Name or service not known addrlist = [] family = 0 flags = host = 'example.com' port = 80 proto = 0 type = /usr/lib64/python3.10/socket.py:955: gaierror The above exception was the direct cause of the following exception: async def test_client_session_timeout_zero() -> None: timeout = client.ClientTimeout(total=10, connect=0, sock_connect=0, sock_read=0) try: async with ClientSession(timeout=timeout) as session: > await session.get("http://example.com") session = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) tests/test_client_session.py:821: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client.py:581: in _request conn = await self._connector.connect( all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'GET' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) redirects = 0 req = self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = True ssl_context = None str_or_url = 'http://example.com' timeout = <_SENTINEL.sentinel: 1> timer = tm = trace_request_ctx = None traces = [] url = URL('http://example.com') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/connector.py:544: in connect proto = await self._create_connection(req, traces, timeout) available = 100 key = ConnectionKey(host='example.com', port=80, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=None) placeholder = proto = None req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/connector.py:944: in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) req = self = timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , req = , traces = [] timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) async def _create_direct_connection( self, req: ClientRequest, traces: List["Trace"], timeout: "ClientTimeout", *, client_error: Type[Exception] = ClientConnectorError, ) -> Tuple[asyncio.Transport, ResponseHandler]: sslcontext = self._get_ssl_context(req) fingerprint = self._get_fingerprint(req) host = req.url.raw_host assert host is not None # Replace multiple trailing dots with a single one. # A trailing dot is only present for fully-qualified domain names. # See https://github.com/aio-libs/aiohttp/pull/7364. if host.endswith(".."): host = host.rstrip(".") + "." port = req.port assert port is not None try: # Cancelling this lookup should not cancel the underlying lookup # or else the cancel event will get broadcast to all the waiters # across all connections. hosts = await self._resolve_host(host, port, traces=traces) except OSError as exc: if exc.errno is None and isinstance(exc, asyncio.TimeoutError): raise # in case of proxy it is not ClientProxyConnectionError # it is problem of resolving proxy ip itself > raise ClientConnectorError(req.connection_key, exc) from exc E aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] client_error = fingerprint = None host = 'example.com' port = 80 req = self = sslcontext = None timeout = ClientTimeout(total=10, connect=0, sock_read=0, sock_connect=0, ceil_threshold=5) traces = [] ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/connector.py:1209: ClientConnectorError _________________________________________________________________________ test_client_session_timeout_bad_argument __________________________________________________________________________ cls = , func = . at 0x7ff60b4b3d90>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: Callable[[], TResult], when: Literal["collect", "setup", "call", "teardown"], reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.04389314400032163 excinfo = \n') tblen=11> func = . at 0x7ff60b4b3d90> precise_start = 1347323.769599469 precise_stop = 1347323.813492613 reraise = (, ) result = None start = 1714128209.7056832 stop = 1714128209.7495778 when = 'call' /usr/lib/python3.10/site-packages/_pytest/runner.py:340: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.10/site-packages/_pytest/runner.py:240: in lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise item = kwds = {} runtest_hook = /usr/lib/python3.10/site-packages/pluggy/_hooks.py:501: in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.10/site-packages/pluggy/_manager.py:119: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>] self = <_pytest.config.PytestPluginManager object at 0x7ff610153df0> /usr/lib/python3.10/site-packages/_pytest/threadexception.py:87: in pytest_runtest_call yield from thread_exception_runtest_hook() /usr/lib/python3.10/site-packages/_pytest/threadexception.py:63: in thread_exception_runtest_hook yield cm = <_pytest.threadexception.catch_threading_exception object at 0x7ff60bfefc70> /usr/lib/python3.10/site-packages/_pytest/unraisableexception.py:90: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: try: yield finally: if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7ff60bfefc10> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.10/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning _____________________________________________________________________________________ test_import_time ______________________________________________________________________________________ pytester = @pytest.mark.internal @pytest.mark.skipif( not sys.platform.startswith("linux") or platform.python_implementation() == "PyPy", reason="Timing is more reliable on Linux", ) def test_import_time(pytester: pytest.Pytester) -> None: """Check that importing aiohttp doesn't take too long. Obviously, the time may vary on different machines and may need to be adjusted from time to time, but this should provide an early warning if something is added that significantly increases import time. """ root = Path(__file__).parent.parent old_path = os.environ.get("PYTHONPATH") os.environ["PYTHONPATH"] = os.pathsep.join([str(root)] + sys.path) best_time_ms = 1000 cmd = "import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000))" try: for _ in range(3): r = pytester.run(sys.executable, "-We", "-c", cmd) assert not r.stderr.str() runtime_ms = int(r.stdout.str()) if runtime_ms < best_time_ms: best_time_ms = runtime_ms finally: if old_path is None: os.environ.pop("PYTHONPATH") else: os.environ["PYTHONPATH"] = old_path expected_time = _TARGET_TIMINGS_BY_PYTHON_VERSION.get( f"{sys.version_info.major}.{sys.version_info.minor}", 200 ) > assert best_time_ms < expected_time E assert 214 < 200 _ = 2 best_time_ms = 214 cmd = "import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000))" expected_time = 200 old_path = '/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib/python3.10/site-packages' pytester = r = root = PosixPath('/home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.5') runtime_ms = 214 /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.5/tests/test_imports.py:71: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-80/test_import_time0 225 running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-80/test_import_time0 215 running: /usr/bin/python3 -We -c import timeit; print(int(timeit.timeit('import aiohttp', number=1) * 1000)) in: /tmp/pytest-of-tkloczko/pytest-80/test_import_time0 214 ____________________________________________________________________________________ test_aiohttp_plugin ____________________________________________________________________________________ testdir = def test_aiohttp_plugin(testdir) -> None: testdir.makepyfile( """\ import pytest from unittest import mock from aiohttp import web async def hello(request): return web.Response(body=b'Hello, world') def create_app(loop=None): app = web.Application() app.router.add_route('GET', '/', hello) return app async def test_hello(aiohttp_client) -> None: client = await aiohttp_client(create_app) resp = await client.get('/') assert resp.status == 200 text = await resp.text() assert 'Hello, world' in text async def test_hello_from_app(aiohttp_client, loop) -> None: app = web.Application() app.router.add_get('/', hello) client = await aiohttp_client(app) resp = await client.get('/') assert resp.status == 200 text = await resp.text() assert 'Hello, world' in text async def test_hello_with_loop(aiohttp_client, loop) -> None: client = await aiohttp_client(create_app) resp = await client.get('/') assert resp.status == 200 text = await resp.text() assert 'Hello, world' in text async def test_set_args(aiohttp_client, loop) -> None: with pytest.raises(AssertionError): app = web.Application() await aiohttp_client(app, 1, 2, 3) async def test_set_keyword_args(aiohttp_client, loop) -> None: app = web.Application() with pytest.raises(TypeError): await aiohttp_client(app, param=1) async def test_noop() -> None: pass async def previous(request): if request.method == 'POST': with pytest.deprecated_call(): # FIXME: this isn't actually called request.app['value'] = (await request.post())['value'] return web.Response(body=b'thanks for the data') else: v = request.app.get('value', 'unknown') return web.Response(body='value: {}'.format(v).encode()) def create_stateful_app(loop): app = web.Application() app.router.add_route('*', '/', previous) return app @pytest.fixture def cli(loop, aiohttp_client): return loop.run_until_complete(aiohttp_client(create_stateful_app)) async def test_set_value(cli) -> None: resp = await cli.post('/', data={'value': 'foo'}) assert resp.status == 200 text = await resp.text() assert text == 'thanks for the data' assert cli.server.app['value'] == 'foo' async def test_get_value(cli) -> None: resp = await cli.get('/') assert resp.status == 200 text = await resp.text() assert text == 'value: unknown' with pytest.warns(DeprecationWarning): cli.server.app['value'] = 'bar' resp = await cli.get('/') assert resp.status == 200 text = await resp.text() assert text == 'value: bar' def test_noncoro() -> None: assert True async def test_failed_to_create_client(aiohttp_client) -> None: def make_app(loop): raise RuntimeError() with pytest.raises(RuntimeError): await aiohttp_client(make_app) async def test_custom_port_aiohttp_client(aiohttp_client, aiohttp_unused_port): port = aiohttp_unused_port() client = await aiohttp_client(create_app, server_kwargs={'port': port}) assert client.port == port resp = await client.get('/') assert resp.status == 200 text = await resp.text() assert 'Hello, world' in text async def test_custom_port_test_server(aiohttp_server, aiohttp_unused_port): app = create_app() port = aiohttp_unused_port() server = await aiohttp_server(app, port=port) assert server.port == port """ ) testdir.makeconftest(CONFTEST) result = testdir.runpytest("-p", "no:sugar", "--aiohttp-loop=pyloop") > result.assert_outcomes(passed=12) E AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} E E Omitting 4 identical items, use -vv to show E Differing items: E {'passed': 10} != {'passed': 12} E {'failed': 2} != {'failed': 0} E Use -v to get more diff result = testdir = /home/tkloczko/rpmbuild/BUILD/aiohttp-3.9.5/tests/test_pytest_plugin.py:150: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ ============================= test session starts ============================== platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0 rootdir: /tmp/pytest-of-tkloczko/pytest-80/test_aiohttp_plugin0 plugins: mock-3.14.0 collected 12 items test_aiohttp_plugin.py ......FF.... [100%] =================================== FAILURES =================================== ____________________________ test_set_value[pyloop] ____________________________ cli = async def test_set_value(cli) -> None: resp = await cli.post('/', data={'value': 'foo'}) > assert resp.status == 200 E AssertionError: assert 500 == 200 E + where 500 = \n\n.status test_aiohttp_plugin.py:82: AssertionError ------------------------------ Captured log call ------------------------------- ERROR aiohttp.server:web_protocol.py:421 Error handling request Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/tmp/pytest-of-tkloczko/pytest-80/test_aiohttp_plugin0/test_aiohttp_plugin.py", line 61, in previous with pytest.deprecated_call(): # FIXME: this isn't actually called File "/usr/lib/python3.10/site-packages/_pytest/recwarn.py", line 336, in __exit__ warnings.warn_explicit( aiohttp.web_exceptions.NotAppKeyWarning: It is recommended to use web.AppKey instances for keys. https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config ____________________________ test_get_value[pyloop] ____________________________ cli = async def test_get_value(cli) -> None: resp = await cli.get('/') assert resp.status == 200 text = await resp.text() assert text == 'value: unknown' > with pytest.warns(DeprecationWarning): E aiohttp.web_exceptions.NotAppKeyWarning: It is recommended to use web.AppKey instances for keys. E https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config test_aiohttp_plugin.py:93: NotAppKeyWarning =========================== short test summary info ============================ FAILED test_aiohttp_plugin.py::test_set_value[pyloop] - AssertionError: asser... FAILED test_aiohttp_plugin.py::test_get_value[pyloop] - aiohttp.web_exception... ========================= 2 failed, 10 passed in 0.53s ========================= ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR aiohttp.server:web_protocol.py:421 Error handling request Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/tmp/pytest-of-tkloczko/pytest-80/test_aiohttp_plugin0/test_aiohttp_plugin.py", line 61, in previous with pytest.deprecated_call(): # FIXME: this isn't actually called File "/usr/lib/python3.10/site-packages/_pytest/recwarn.py", line 336, in __exit__ warnings.warn_explicit( aiohttp.web_exceptions.NotAppKeyWarning: It is recommended to use web.AppKey instances for keys. https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config __________________________________________________________________________________ test_send_compress_text __________________________________________________________________________________ self = , args = (b'\xc1\x05*\x01b\x00\x00',), kwargs = {}, expected = call(b'\xc1\x05*\x01b\x00\x00'), actual = call(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7ff60a2b7f40>, cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher(_Call((args, kwargs), two=True)) actual = self._call_matcher(self.call_args) if actual != expected: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') _error_message = ._error_message at 0x7ff60a2b7f40> actual = call(b'\xc1\x04\x02a\x00\x00') args = (b'\xc1\x05*\x01b\x00\x00',) cause = None expected = call(b'\xc1\x05*\x01b\x00\x00') kwargs = {} self = /usr/lib64/python3.10/unittest/mock.py:929: AssertionError During handling of the above exception, another exception occurred: protocol = , transport = async def test_send_compress_text(protocol, transport) -> None: writer = WebSocketWriter(protocol, transport, compress=15) await writer.send(b"text") writer.transport.write.assert_called_with(b"\xc1\x06*I\xad(\x01\x00") await writer.send(b"text") > writer.transport.write.assert_called_with(b"\xc1\x05*\x01b\x00\x00") E AssertionError: expected call not found. E Expected: write(b'\xc1\x05*\x01b\x00\x00') E Actual: write(b'\xc1\x04\x02a\x00\x00') E E pytest introspection follows: E E Args: E assert (b'\xc1\x04\x02a\x00\x00',) == (b'\xc1\x05*\x01b\x00\x00',) E E At index 0 diff: b'\xc1\x04\x02a\x00\x00' != b'\xc1\x05*\x01b\x00\x00' E Use -v to get more diff protocol = transport = writer = tests/test_websocket_writer.py:91: AssertionError ____________________________________________________________________________ test_send_compress_text_notakeover _____________________________________________________________________________ cls = , func = . at 0x7ff60a2b7130>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: Callable[[], TResult], when: Literal["collect", "setup", "call", "teardown"], reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": """Call func, wrapping the result in a CallInfo. :param func: The function to call. Called without arguments. :param when: The phase in which the function is called. :param reraise: Exception or exceptions that shall propagate if raised by the function, instead of being wrapped in the CallInfo. """ excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() cls = duration = 0.05476351408287883 excinfo = \n') tblen=11> func = . at 0x7ff60a2b7130> precise_start = 1347438.142976496 precise_stop = 1347438.19774001 reraise = (, ) result = None start = 1714128324.0790603 stop = 1714128324.1338255 when = 'call' /usr/lib/python3.10/site-packages/_pytest/runner.py:340: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.10/site-packages/_pytest/runner.py:240: in lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise item = kwds = {} runtest_hook = /usr/lib/python3.10/site-packages/pluggy/_hooks.py:501: in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) firstresult = False kwargs = {'item': } self = /usr/lib/python3.10/site-packages/pluggy/_manager.py:119: in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) firstresult = False hook_name = 'pytest_runtest_call' kwargs = {'item': } methods = [>] self = <_pytest.config.PytestPluginManager object at 0x7ff610153df0> /usr/lib/python3.10/site-packages/_pytest/threadexception.py:87: in pytest_runtest_call yield from thread_exception_runtest_hook() /usr/lib/python3.10/site-packages/_pytest/threadexception.py:63: in thread_exception_runtest_hook yield cm = <_pytest.threadexception.catch_threading_exception object at 0x7ff60cedf670> /usr/lib/python3.10/site-packages/_pytest/unraisableexception.py:90: in pytest_runtest_call yield from unraisable_exception_runtest_hook() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def unraisable_exception_runtest_hook() -> Generator[None, None, None]: with catch_unraisable_exception() as cm: try: yield finally: if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) E pytest.PytestUnraisableExceptionWarning: Exception ignored in: E E Traceback (most recent call last): E File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/test_utils.py", line 537, in teardown_test_loop E gc.collect() E ResourceWarning: unclosed cm = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7ff60cede140> err_msg = 'Exception ignored in' msg = 'Exception ignored in: \n\nTr...nResourceWarning: unclosed \n' /usr/lib/python3.10/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning ========================================================================================= XFAILURES ========================================================================================= ______________________________________________________________________________ test_broken_connection[pyloop] _______________________________________________________________________________ aiohttp_client = .go at 0x7ff60e56e710> @pytest.mark.xfail async def test_broken_connection(aiohttp_client) -> None: async def handler(request): request.transport.close() return web.Response(text="answer" * 1000) app = web.Application() app.router.add_get("/", handler) client = await aiohttp_client(app) with pytest.raises(aiohttp.ClientResponseError): > await client.get("/") aiohttp_client = .go at 0x7ff60e56e710> app = client = handler = .handler at 0x7ff60dd92b00> tests/test_client_functional.py:2316: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/test_utils.py:322: in _request resp = await self._session.request(method, self.make_url(path), **kwargs) kwargs = {} method = 'GET' path = '/' self = ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client.py:608: in _request await resp.start(conn) all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None conn = Connection cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'GET' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=None, ceil_threshold=5) redirects = 0 req = resp = None self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = True ssl_context = None str_or_url = URL('http://127.0.0.1:40125/') timeout = <_SENTINEL.sentinel: 1> timer = tm = trace_request_ctx = None traces = [] url = URL('http://127.0.0.1:40125/') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client_reqrep.py:976: in start message, payload = await protocol.read() # type: ignore[union-attr] connection = Connection protocol = self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def read(self) -> _T: if not self._buffer and not self._eof: assert not self._waiter self._waiter = self._loop.create_future() try: > await self._waiter E aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected self = ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/streams.py:640: ServerDisconnectedError _______________________________________________________________________________ test_rejected_upload[pyloop] ________________________________________________________________________________ aiohttp_client = .go at 0x7ff60e56e680>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-80/test_rejected_upload_pyloop_0') @pytest.mark.xfail(raises=asyncio.TimeoutError, reason="#7599") async def test_rejected_upload(aiohttp_client, tmp_path) -> None: async def ok_handler(request): return web.Response() async def not_ok_handler(request): raise web.HTTPBadRequest() app = web.Application() app.router.add_get("/ok", ok_handler) app.router.add_post("/not_ok", not_ok_handler) client = await aiohttp_client(app) file_size_bytes = 1024 * 1024 file_path = tmp_path / "uploaded.txt" file_path.write_text("0" * file_size_bytes, encoding="utf8") with open(file_path, "rb") as file: data = {"file": file} async with await client.post("/not_ok", data=data) as resp_not_ok: assert 400 == resp_not_ok.status > async with await client.get( "/ok", timeout=aiohttp.ClientTimeout(total=0.01) ) as resp_ok: aiohttp_client = .go at 0x7ff60e56e680> app = client = data = {'file': <_io.BufferedReader name='/tmp/pytest-of-tkloczko/pytest-80/test_rejected_upload_pyloop_0/uploaded.txt'>} file = <_io.BufferedReader name='/tmp/pytest-of-tkloczko/pytest-80/test_rejected_upload_pyloop_0/uploaded.txt'> file_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-80/test_rejected_upload_pyloop_0/uploaded.txt') file_size_bytes = 1048576 not_ok_handler = .not_ok_handler at 0x7ff60b4b1b40> ok_handler = .ok_handler at 0x7ff60cc5e290> resp_not_ok = tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-80/test_rejected_upload_pyloop_0') tests/test_client_functional.py:3412: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/test_utils.py:322: in _request resp = await self._session.request(method, self.make_url(path), **kwargs) kwargs = {'timeout': ClientTimeout(total=0.01, connect=None, sock_read=None, sock_connect=None, ceil_threshold=5)} method = 'GET' path = '/ok' self = ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client.py:608: in _request await resp.start(conn) all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None conn = Connection cookies = None data = None expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'GET' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=0.01, connect=None, sock_read=None, sock_connect=None, ceil_threshold=5) redirects = 0 req = resp = None self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = True ssl_context = None str_or_url = URL('http://127.0.0.1:39305/ok') timeout = ClientTimeout(total=0.01, connect=None, sock_read=None, sock_connect=None, ceil_threshold=5) timer = tm = trace_request_ctx = None traces = [] url = URL('http://127.0.0.1:39305/ok') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client_reqrep.py:971: in start with self._timer: connection = Connection protocol = self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , exc_type = , exc_val = CancelledError() exc_tb = def __exit__( self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType], ) -> Optional[bool]: if self._tasks: self._tasks.pop() if exc_type is asyncio.CancelledError and self._cancelled: > raise asyncio.TimeoutError from None E asyncio.exceptions.TimeoutError exc_tb = exc_type = exc_val = CancelledError() self = ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/helpers.py:735: TimeoutError __________________________________________________________________________ test_del_with_scheduled_cleanup[pyloop] __________________________________________________________________________ self = , args = (<_UnixSelectorEventLoop running=False closed=False debug=True>, {'connector': , 'message': 'Unclosed connector', 'source_traceback': }) kwargs = {}, expected = call(<_UnixSelectorEventLoop running=False closed=False debug=True>, {'connector': , 'message': 'Unclosed connector', 'source_traceback': }) actual = call(<_UnixSelectorEventLoop running=False closed=False debug=True>, {'connector': ]}) _error_message = ._error_message at 0x7ff60b4b3d90>, cause = None def assert_called_with(self, /, *args, **kwargs): """assert that the last call was made with the specified arguments. Raises an AssertionError if the args and keyword args passed in are different to the last call to the mock.""" if self.call_args is None: expected = self._format_mock_call_signature(args, kwargs) actual = 'not called.' error_message = ('expected call not found.\nExpected: %s\nActual: %s' % (expected, actual)) raise AssertionError(error_message) def _error_message(): msg = self._format_mock_failure_message(args, kwargs) return msg expected = self._call_matcher(_Call((args, kwargs), two=True)) actual = self._call_matcher(self.call_args) if actual != expected: cause = expected if isinstance(expected, Exception) else None > raise AssertionError(_error_message()) from cause E AssertionError: expected call not found. E Expected: mock(<_UnixSelectorEventLoop running=True closed=False debug=True>, {'connector': , 'message': 'Unclosed connector', 'source_traceback': }) E Actual: mock(<_UnixSelectorEventLoop running=True closed=False debug=True>, {'connector': , 'connections': ["[(, 123)]"], 'message': 'Unclosed connector', 'source_traceback': [>, , , , , , , , , , , , , , , , , , , , >, , , , , , , , , , , , , , ]}) _error_message = ._error_message at 0x7ff60b4b3d90> actual = call(<_UnixSelectorEventLoop running=False closed=False debug=True>, {'connector': ]}) args = (<_UnixSelectorEventLoop running=False closed=False debug=True>, {'connector': , 'message': 'Unclosed connector', 'source_traceback': }) cause = None expected = call(<_UnixSelectorEventLoop running=False closed=False debug=True>, {'connector': , 'message': 'Unclosed connector', 'source_traceback': }) kwargs = {} self = /usr/lib64/python3.10/unittest/mock.py:929: AssertionError During handling of the above exception, another exception occurred: loop = <_UnixSelectorEventLoop running=False closed=False debug=True> @pytest.mark.xfail async def test_del_with_scheduled_cleanup(loop) -> None: loop.set_debug(True) conn = aiohttp.BaseConnector(loop=loop, keepalive_timeout=0.01) transp = mock.Mock() conn._conns["a"] = [(transp, 123)] conns_impl = conn._conns exc_handler = mock.Mock() loop.set_exception_handler(exc_handler) with pytest.warns(ResourceWarning): # obviously doesn't deletion because loop has a strong # reference to connector's instance method, isn't it? del conn await asyncio.sleep(0.01) gc.collect() assert not conns_impl transp.close.assert_called_with() msg = {"connector": mock.ANY, "message": "Unclosed connector"} # conn was deleted if loop.get_debug(): msg["source_traceback"] = mock.ANY > exc_handler.assert_called_with(loop, msg) E AssertionError: expected call not found. E Expected: mock(<_UnixSelectorEventLoop running=True closed=False debug=True>, {'connector': , 'message': 'Unclosed connector', 'source_traceback': }) E Actual: mock(<_UnixSelectorEventLoop running=True closed=False debug=True>, {'connector': , 'connections': ["[(, 123)]"], 'message': 'Unclosed connector', 'source_traceback': [>, , , , , , , , , , , , , , , , , , , , >, , , , , , , , , , , , , , ]}) E E pytest introspection follows: E E Args: E assert (<_UnixSelect...ed_cleanup>]}) == (<_UnixSelect...back': }) E E At index 1 diff: {'connector': , 'connections': ["[(, 123)]"], 'message': 'Unclosed connector', 'source_traceback'... E E ...Full output truncated (2 lines hidden), use '-vv' to show conns_impl = {} exc_handler = loop = <_UnixSelectorEventLoop running=False closed=False debug=True> msg = {'connector': , 'message': 'Unclosed connector', 'source_traceback': } transp = tests/test_connector.py:200: AssertionError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- WARNING asyncio:base_events.py:1904 Executing exception=AssertionError('expected call not found.\nExpected: mock(<_UnixSelectorEventLoop running=True closed=False debug=True>, {\'connector\': , \'message\': \'Unclosed connector\', \'source_traceback\': })\nActual: mock(<_UnixSelectorEventLoop running=True closed=False debug=True>, {\'connector\': , \'connections\': ["[(, 123)]"], \'message\': \'Unclosed connector\', \'source_traceback\': [>, , , , , , , , , , , , , , , , , , , , >, , , , , , , , , , , , , , ]})\n\npytest introspection follows:\n\nArgs:\nassert (<_UnixSelect...ed_cleanup>]}) == (<_UnixSelect...back\': })\n \n At index 1 diff: \x1b[0m{\x1b[33m\'\x1b[39;49;00m\x1b[33mconnector\x1b[39;49;00m\x1b[33m\'\x1b[39;49;00m: , \x1b[33m\'\x1b[39;49;00m\x1b[33mconnections\x1b[39;49;00m\x1b[33m\'\x1b[39;49;00m: [\x1b[33m"\x1b[39;49;00m\x1b[33m[(, 123)]\x1b[39;49;00m\x1b[33m"\x1b[39;49;00m], \x1b[33m\'\x1b[39;49;00m\x1b[33mmessage\x1b[39;49;00m\x1b[33m\'\x1b[39;49;00m: \x1b[33m\'\x1b[39;49;00m\x1b[33mUnclosed connector\x1b[39;49;00m\x1b[33m\'\x1b[39;49;00m, \x1b[33m\'\x1b[39;49;00m\x1b[33msource_traceback\x1b[39;49;00m\x1b[33m\'...\n \n ...Full output truncated (2 lines hidden), use \'-vv\' to show')> took 0.110 seconds _____________________________________________________________________ test_parse_unusual_request_line[py-parser-pyloop] _____________________________________________________________________ parser = def test_parse_unusual_request_line(parser) -> None: if not isinstance(response, HttpResponseParserPy): > pytest.xfail("Regression test for Py parser. May match C behaviour later.") E _pytest.outcomes.XFailed: Regression test for Py parser. May match C behaviour later. parser = tests/test_http_parser.py:299: XFailed _____________________________________________________________________ test_parse_unusual_request_line[c-parser-pyloop] ______________________________________________________________________ parser = def test_parse_unusual_request_line(parser) -> None: if not isinstance(response, HttpResponseParserPy): > pytest.xfail("Regression test for Py parser. May match C behaviour later.") E _pytest.outcomes.XFailed: Regression test for Py parser. May match C behaviour later. parser = tests/test_http_parser.py:299: XFailed _______________________________________________________ test_invalid_header_spacing[py-parser-pyloop-pre-empty-post-empty-name-empty] _______________________________________________________ parser = , pad1 = b'', pad2 = b'', hdr = b'' @pytest.mark.parametrize("hdr", [b"", b"foo"], ids=["name-empty", "with-name"]) @pytest.mark.parametrize("pad2", _pad.keys(), ids=["post-" + n for n in _pad.values()]) @pytest.mark.parametrize("pad1", _pad.keys(), ids=["pre-" + n for n in _pad.values()]) def test_invalid_header_spacing(parser, pad1: bytes, pad2: bytes, hdr: bytes) -> None: text = b"GET /test HTTP/1.1\r\n" b"%s%s%s: value\r\n\r\n" % (pad1, hdr, pad2) expectation = pytest.raises(http_exceptions.BadHttpMessage) if pad1 == pad2 == b"" and hdr != b"": # one entry in param matrix is correct: non-empty name, not padded expectation = nullcontext() if pad1 == pad2 == hdr == b"": if not isinstance(response, HttpResponseParserPy): > pytest.xfail("Regression test for Py parser. May match C behaviour later.") E _pytest.outcomes.XFailed: Regression test for Py parser. May match C behaviour later. expectation = <_pytest.python_api.RaisesContext object at 0x7ff60dea3fd0> hdr = b'' pad1 = b'' pad2 = b'' parser = text = b'GET /test HTTP/1.1\r\n: value\r\n\r\n' tests/test_http_parser.py:637: XFailed _______________________________________________________ test_invalid_header_spacing[c-parser-pyloop-pre-empty-post-empty-name-empty] ________________________________________________________ parser = , pad1 = b'', pad2 = b'', hdr = b'' @pytest.mark.parametrize("hdr", [b"", b"foo"], ids=["name-empty", "with-name"]) @pytest.mark.parametrize("pad2", _pad.keys(), ids=["post-" + n for n in _pad.values()]) @pytest.mark.parametrize("pad1", _pad.keys(), ids=["pre-" + n for n in _pad.values()]) def test_invalid_header_spacing(parser, pad1: bytes, pad2: bytes, hdr: bytes) -> None: text = b"GET /test HTTP/1.1\r\n" b"%s%s%s: value\r\n\r\n" % (pad1, hdr, pad2) expectation = pytest.raises(http_exceptions.BadHttpMessage) if pad1 == pad2 == b"" and hdr != b"": # one entry in param matrix is correct: non-empty name, not padded expectation = nullcontext() if pad1 == pad2 == hdr == b"": if not isinstance(response, HttpResponseParserPy): > pytest.xfail("Regression test for Py parser. May match C behaviour later.") E _pytest.outcomes.XFailed: Regression test for Py parser. May match C behaviour later. expectation = <_pytest.python_api.RaisesContext object at 0x7ff60cfffc70> hdr = b'' pad1 = b'' pad2 = b'' parser = text = b'GET /test HTTP/1.1\r\n: value\r\n\r\n' tests/test_http_parser.py:637: XFailed _______________________________________________________________ test_http_request_parser_utf8_request_line[py-parser-pyloop] ________________________________________________________________ parser = def test_http_request_parser_utf8_request_line(parser) -> None: if not isinstance(response, HttpResponseParserPy): > pytest.xfail("Regression test for Py parser. May match C behaviour later.") E _pytest.outcomes.XFailed: Regression test for Py parser. May match C behaviour later. parser = tests/test_http_parser.py:820: XFailed ________________________________________________________________ test_http_request_parser_utf8_request_line[c-parser-pyloop] ________________________________________________________________ parser = def test_http_request_parser_utf8_request_line(parser) -> None: if not isinstance(response, HttpResponseParserPy): > pytest.xfail("Regression test for Py parser. May match C behaviour later.") E _pytest.outcomes.XFailed: Regression test for Py parser. May match C behaviour later. parser = tests/test_http_parser.py:820: XFailed ___________________________________________________________________________ test_parse_uri_utf8[c-parser-pyloop] ____________________________________________________________________________ parser = def test_parse_uri_utf8(parser) -> None: if not isinstance(parser, HttpRequestParserPy): > pytest.xfail("Not valid HTTP. Maybe update py-parser to reject later.") E _pytest.outcomes.XFailed: Not valid HTTP. Maybe update py-parser to reject later. parser = tests/test_http_parser.py:1411: XFailed __________________________________________________________________________ test_http10_keep_alive_default[pyloop] ___________________________________________________________________________ aiohttp_client = .go at 0x7ff60af35480> @pytest.mark.xfail async def test_http10_keep_alive_default(aiohttp_client) -> None: async def handler(request): return web.Response() app = web.Application() app.router.add_get("/", handler) client = await aiohttp_client(app, version=HttpVersion10) resp = await client.get("/") assert 200 == resp.status assert resp.version == HttpVersion10 > assert resp.headers["Connection"] == "keep-alive" E KeyError: 'Connection' aiohttp_client = .go at 0x7ff60af35480> app = client = handler = .handler at 0x7ff60b2035b0> resp = tests/test_web_functional.py:654: KeyError _____________________________________________________________________________ test_unsupported_upgrade[pyloop] ______________________________________________________________________________ aiohttp_raw_server = .go at 0x7ff60ad96f80>, aiohttp_client = .go at 0x7ff60ad97490> @pytest.mark.xfail( not helpers.NO_EXTENSIONS, raises=client.ServerDisconnectedError, reason="The behavior of C-extensions differs from pure-Python: " "https://github.com/aio-libs/aiohttp/issues/6446", ) async def test_unsupported_upgrade(aiohttp_raw_server, aiohttp_client) -> None: # don't fail if a client probes for an unsupported protocol upgrade # https://github.com/aio-libs/aiohttp/issues/6446#issuecomment-999032039 async def handler(request: web.Request): return web.Response(body=await request.read()) upgrade_headers = {"Connection": "Upgrade", "Upgrade": "unsupported_proto"} server = await aiohttp_raw_server(handler) cli = await aiohttp_client(server) test_data = b"Test" > resp = await cli.post("/path/to", data=test_data, headers=upgrade_headers) aiohttp_client = .go at 0x7ff60ad97490> aiohttp_raw_server = .go at 0x7ff60ad96f80> cli = handler = .handler at 0x7ff60ad96e60> server = test_data = b'Test' upgrade_headers = {'Connection': 'Upgrade', 'Upgrade': 'unsupported_proto'} tests/test_web_server.py:38: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/test_utils.py:322: in _request resp = await self._session.request(method, self.make_url(path), **kwargs) kwargs = {'data': b'Test', 'headers': {'Connection': 'Upgrade', 'Upgrade': 'unsupported_proto'}} method = 'POST' path = '/path/to' self = ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client.py:608: in _request await resp.start(conn) all_cookies = allow_redirects = True auth = None auth_from_url = None auto_decompress = True chunked = None compress = None conn = Connection cookies = None data = b'Test' expect100 = False fingerprint = None handle = None headers = history = [] json = None max_field_size = 8190 max_line_size = 8190 max_redirects = 10 method = 'POST' params = {} proxy = None proxy_auth = None proxy_headers = raise_for_status = None read_bufsize = 65536 read_until_eof = True real_timeout = ClientTimeout(total=300, connect=None, sock_read=None, sock_connect=None, ceil_threshold=5) redirects = 0 req = resp = None self = server_hostname = None skip_auto_headers = None skip_headers = set() ssl = True ssl_context = None str_or_url = URL('http://127.0.0.1:41173/path/to') timeout = <_SENTINEL.sentinel: 1> timer = tm = trace_request_ctx = None traces = [] url = URL('http://127.0.0.1:41173/path/to') verify_ssl = None version = HttpVersion(major=1, minor=1) ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/client_reqrep.py:976: in start message, payload = await protocol.read() # type: ignore[union-attr] connection = Connection protocol = self = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = async def read(self) -> _T: if not self._buffer and not self._eof: assert not self._waiter self._waiter = self._loop.create_future() try: > await self._waiter E aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected self = ../../BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/streams.py:640: ServerDisconnectedError ------------------------------------------------------------------------------------- Captured log call ------------------------------------------------------------------------------------- ERROR aiohttp.server:web_protocol.py:421 Unhandled exception Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_protocol.py", line 531, in start resp, reset = await task File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request reset = await self.finish_response(request, resp, start_time) File "/home/tkloczko/rpmbuild/BUILDROOT/python-aiohttp-3.9.5-2.fc37.x86_64/usr/lib64/python3.10/site-packages/aiohttp/web_protocol.py", line 616, in finish_response self._request_parser.feed_data(self._message_tail) File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data raise ex aiohttp.http_exceptions.BadStatusLine: 400, message: Invalid method encountered: b'Test' ^ ______________________________________________________________________ test_decoded_url_match[pyloop-urldecoded_route] ______________________________________________________________________ aiohttp_client = .go at 0x7ff60ad97130>, route_definition = '/467,802,24834/hello', urlencoded_path = '/467%2C802%2C24834/hello' expected_http_resp_status = 200 @pytest.mark.xfail( raises=AssertionError, reason="Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621", ) @pytest.mark.parametrize( ("route_definition", "urlencoded_path", "expected_http_resp_status"), ( ("/467,802,24834/hello", "/467%2C802%2C24834/hello", 200), ("/{user_ids:([0-9]+)(,([0-9]+))*}/hello", "/467%2C802%2C24834/hello", 200), ("/1%2C3/hello", "/1%2C3/hello", 404), ), ids=("urldecoded_route", "urldecoded_route_with_regex", "urlencoded_route"), ) async def test_decoded_url_match( aiohttp_client: AiohttpClient, route_definition: str, urlencoded_path: str, expected_http_resp_status: int, ) -> None: app = web.Application() async def handler(request: web.Request) -> web.Response: return web.Response() app.router.add_get(route_definition, handler) client = await aiohttp_client(app) r = await client.get(yarl.URL(urlencoded_path, encoded=True)) > assert r.status == expected_http_resp_status E AssertionError: assert 404 == 200 E + where 404 = \n\n.status aiohttp_client = .go at 0x7ff60ad97130> app = client = expected_http_resp_status = 200 handler = .handler at 0x7ff60ad96710> r = route_definition = '/467,802,24834/hello' urlencoded_path = '/467%2C802%2C24834/hello' tests/test_web_urldispatcher.py:753: AssertionError ________________________________________________________________ test_decoded_url_match[pyloop-urldecoded_route_with_regex] _________________________________________________________________ aiohttp_client = .go at 0x7ff60a2b5900>, route_definition = '/{user_ids:([0-9]+)(,([0-9]+))*}/hello', urlencoded_path = '/467%2C802%2C24834/hello' expected_http_resp_status = 200 @pytest.mark.xfail( raises=AssertionError, reason="Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621", ) @pytest.mark.parametrize( ("route_definition", "urlencoded_path", "expected_http_resp_status"), ( ("/467,802,24834/hello", "/467%2C802%2C24834/hello", 200), ("/{user_ids:([0-9]+)(,([0-9]+))*}/hello", "/467%2C802%2C24834/hello", 200), ("/1%2C3/hello", "/1%2C3/hello", 404), ), ids=("urldecoded_route", "urldecoded_route_with_regex", "urlencoded_route"), ) async def test_decoded_url_match( aiohttp_client: AiohttpClient, route_definition: str, urlencoded_path: str, expected_http_resp_status: int, ) -> None: app = web.Application() async def handler(request: web.Request) -> web.Response: return web.Response() app.router.add_get(route_definition, handler) client = await aiohttp_client(app) r = await client.get(yarl.URL(urlencoded_path, encoded=True)) > assert r.status == expected_http_resp_status E AssertionError: assert 404 == 200 E + where 404 = \n\n.status aiohttp_client = .go at 0x7ff60a2b5900> app = client = expected_http_resp_status = 200 handler = .handler at 0x7ff60ad96d40> r = route_definition = '/{user_ids:([0-9]+)(,([0-9]+))*}/hello' urlencoded_path = '/467%2C802%2C24834/hello' tests/test_web_urldispatcher.py:753: AssertionError ______________________________________________________________________ test_decoded_url_match[pyloop-urlencoded_route] ______________________________________________________________________ aiohttp_client = .go at 0x7ff60a2b5a20>, route_definition = '/1%2C3/hello', urlencoded_path = '/1%2C3/hello', expected_http_resp_status = 404 @pytest.mark.xfail( raises=AssertionError, reason="Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621", ) @pytest.mark.parametrize( ("route_definition", "urlencoded_path", "expected_http_resp_status"), ( ("/467,802,24834/hello", "/467%2C802%2C24834/hello", 200), ("/{user_ids:([0-9]+)(,([0-9]+))*}/hello", "/467%2C802%2C24834/hello", 200), ("/1%2C3/hello", "/1%2C3/hello", 404), ), ids=("urldecoded_route", "urldecoded_route_with_regex", "urlencoded_route"), ) async def test_decoded_url_match( aiohttp_client: AiohttpClient, route_definition: str, urlencoded_path: str, expected_http_resp_status: int, ) -> None: app = web.Application() async def handler(request: web.Request) -> web.Response: return web.Response() app.router.add_get(route_definition, handler) client = await aiohttp_client(app) r = await client.get(yarl.URL(urlencoded_path, encoded=True)) > assert r.status == expected_http_resp_status E AssertionError: assert 200 == 404 E + where 200 = \n\n.status aiohttp_client = .go at 0x7ff60a2b5a20> app = client = expected_http_resp_status = 404 handler = .handler at 0x7ff60ad96e60> r = route_definition = '/1%2C3/hello' urlencoded_path = '/1%2C3/hello' tests/test_web_urldispatcher.py:753: AssertionError =================================================================================== slowest 10 durations ==================================================================================== 9.52s call tests/test_run_app.py::TestShutdown::test_shutdown_new_conn_rejected 4.01s call tests/test_run_app.py::TestShutdown::test_shutdown_pending_handler_responds 2.51s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_spawned_task 2.51s call tests/test_run_app.py::TestShutdown::test_shutdown_wait_for_task 2.01s call tests/test_client_functional.py::test_read_timeout_between_chunks[pyloop] 2.00s call tests/test_client_functional.py::test_set_cookies_max_age[pyloop] 1.51s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_task 1.51s call tests/test_run_app.py::TestShutdown::test_shutdown_timeout_not_reached 1.02s call tests/test_run_app.py::TestShutdown::test_shutdown_close_websockets 1.01s call tests/test_run_app.py::TestShutdown::test_shutdown_close_idle_keepalive ================================================================================== short test summary info ================================================================================== SKIPPED [1] tests/test_client_session.py:781: The check is applied in DEBUG mode only SKIPPED [1] tests/test_connector.py:1972: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1980: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:1991: Proactor Event loop present only in Windows SKIPPED [1] tests/test_connector.py:2174: Proactor Event loop present only in Windows SKIPPED [1] tests/test_multipart_helpers.py:99: need more smart parser which respects quoted text SKIPPED [1] tests/test_multipart_helpers.py:446: should raise decoding error: %82 is invalid for latin1 SKIPPED [1] tests/test_multipart_helpers.py:455: should raise decoding error: %E4 is invalid for utf-8 SKIPPED [1] tests/test_multipart_helpers.py:510: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [1] tests/test_multipart_helpers.py:519: urllib.parse.unquote is tolerate to standalone % chars SKIPPED [2] tests/test_proxy_functional.py:105: asyncio on this python does not support TLS in TLS SKIPPED [1] tests/test_proxy_functional.py:394: we need to reconsider how we test this SKIPPED [1] tests/test_proxy_functional.py:418: we need to reconsider how we test this SKIPPED [1] tests/test_web_app.py:365: The check is applied in DEBUG mode only SKIPPED [1] tests/test_web_runner.py:121: Proactor Event loop present only in Windows SKIPPED [1] tests/test_web_runner.py:131: Proactor Event loop present only in Windows XFAIL tests/test_client_functional.py::test_broken_connection[pyloop] XFAIL tests/test_client_functional.py::test_rejected_upload[pyloop] - #7599 XFAIL tests/test_connector.py::test_del_with_scheduled_cleanup[pyloop] XFAIL tests/test_http_parser.py::test_parse_unusual_request_line[py-parser-pyloop] - reason: Regression test for Py parser. May match C behaviour later. XFAIL tests/test_http_parser.py::test_parse_unusual_request_line[c-parser-pyloop] - reason: Regression test for Py parser. May match C behaviour later. XFAIL tests/test_http_parser.py::test_invalid_header_spacing[py-parser-pyloop-pre-empty-post-empty-name-empty] - reason: Regression test for Py parser. May match C behaviour later. XFAIL tests/test_http_parser.py::test_invalid_header_spacing[c-parser-pyloop-pre-empty-post-empty-name-empty] - reason: Regression test for Py parser. May match C behaviour later. XFAIL tests/test_http_parser.py::test_http_request_parser_utf8_request_line[py-parser-pyloop] - reason: Regression test for Py parser. May match C behaviour later. XFAIL tests/test_http_parser.py::test_http_request_parser_utf8_request_line[c-parser-pyloop] - reason: Regression test for Py parser. May match C behaviour later. XFAIL tests/test_http_parser.py::test_parse_uri_utf8[c-parser-pyloop] - reason: Not valid HTTP. Maybe update py-parser to reject later. XFAIL tests/test_web_functional.py::test_http10_keep_alive_default[pyloop] XFAIL tests/test_web_server.py::test_unsupported_upgrade[pyloop] - The behavior of C-extensions differs from pure-Python: https://github.com/aio-libs/aiohttp/issues/6446 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urldecoded_route_with_regex] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 XFAIL tests/test_web_urldispatcher.py::test_decoded_url_match[pyloop-urlencoded_route] - Regression in v3.7: https://github.com/aio-libs/aiohttp/issues/5621 FAILED tests/test_client_session.py::test_client_session_timeout_zero - aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host example.com:80 ssl:default [Name or service not known] FAILED tests/test_client_session.py::test_client_session_timeout_bad_argument - pytest.PytestUnraisableExceptionWarning: Exception ignored in: FAILED tests/test_imports.py::test_import_time - assert 214 < 200 FAILED tests/test_pytest_plugin.py::test_aiohttp_plugin - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...} FAILED tests/test_websocket_writer.py::test_send_compress_text - AssertionError: expected call not found. FAILED tests/test_websocket_writer.py::test_send_compress_text_notakeover - pytest.PytestUnraisableExceptionWarning: Exception ignored in: ===================================================== 6 failed, 3076 passed, 17 skipped, 10 deselected, 15 xfailed in 158.43s (0:02:38) ===================================================== ```
kloczek commented 6 months ago

So those 6 fails are OK? 🤔

Dreamsorcerer commented 6 months ago

Please run with -m not internal. It was mentioned in the changelog, but could probably be documented somewhere else too.

If you're able to figure out why these 3 are failing and come up with some suggestions on how to improve the tests we'll update them. But, we probably can't help any further at this point.

  • test_client_session.py::test_client_session_timeout_zero
  • test_pytest_plugin.py::test_aiohttp_plugin
  • test_websocket_writer.py::test_send_compress_text

The other 2, as mentioned before, are resource warnings caused by the previous test failing, so can be ignored.

kloczek commented 6 months ago

Maybe it would be good to change logic to disable by default those units and on pytest mark enable? 🤔

Dreamsorcerer commented 6 months ago

Maybe it would be good to change logic to disable by default those units and on pytest mark enable? 🤔

Not possible, I already tried. Feel free to make a PR if you can figure something out.