Skip to content

Remove pytest_plugin #10762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from
Draft

Remove pytest_plugin #10762

wants to merge 45 commits into from

Conversation

Dreamsorcerer
Copy link
Member

This will be maintained exclusively in pytest-aiohttp going forwards.

@Dreamsorcerer Dreamsorcerer added the backport:skip Skip backport bot label Apr 20, 2025
Copy link

codecov bot commented Apr 20, 2025

❌ 13 Tests Failed:

Tests completed Failed Passed Skipped
3544 13 3531 70
View the top 3 failed test(s) by shortest run time
tests.test_web_runner::test_named_pipe_runner_proactor_loop
Stack Traces | 0.004s run time
file D:\a\aiohttp\aiohttp\tests\test_web_runner.py, line 230
  @pytest.mark.skipif(
      platform.system() != "Windows", reason="Proactor Event loop present only in Windows"
  )
  async def test_named_pipe_runner_proactor_loop(
      proactor_event_loop: asyncio.AbstractEventLoop, app: web.Application, pipe_name: str
  ) -> None:
      runner = web.AppRunner(app)
      await runner.setup()
      pipe = web.NamedPipeSite(runner, pipe_name)
      await pipe.start()
      await runner.cleanup()
#x1B[31mE       fixture 'proactor_event_loop' not found#x1B[0m
#x1B[31m>       available fixtures: LineMatcher, _config_for_test, _pytest, _session_event_loop, _sys_snapshot, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, app, benchmark, blockbuster, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, class_mocker, client_ssl_ctx, codspeed_benchmark, cov, create_mocked_conn, doctest_namespace, enable_cleanup_closed, event_loop, event_loop_policy, key, key_data, linecomp, make_runner, mocker, module_mocker, monkeypatch, netrc_contents, no_cover, package_mocker, parametrize_zlib_backend, pipe_name, proactor_loop, pytestconfig, pytester, record_property, record_testsuite_property, record_xml_attribute, recwarn, selector_loop, session_mocker, ssl_ctx, start_connection, testdir, testrun_uid, tests/test_web_runner.py::<event_loop>, tls_ca_certificate_pem_path, tls_certificate, tls_certificate_authority, tls_certificate_fingerprint_sha256, tls_certificate_pem_bytes, tls_certificate_pem_path, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unix_sockname, unused_port_socket, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, uvloop_loop, worker_id, ws_key#x1B[0m
#x1B[31m>       use 'pytest --fixtures [testpath]' for help on them.#x1B[0m

D:\a\aiohttp\aiohttp\tests\test_web_runner.py:230
tests.test_cookiejar.TestCookieJarSafe test_cookie_not_expired_when_added_after_removal
Stack Traces | 0.006s run time
cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x0000023600AA6EF0>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mfrom_call#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        func: Callable[[], TResult],#x1B[90m#x1B[39;49;00m
        when: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mcollect#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33msetup#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcall#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mteardown#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        reraise: Optional[#x1B[90m#x1B[39;49;00m
            Union[Type[#x1B[96mBaseException#x1B[39;49;00m], Tuple[Type[#x1B[96mBaseException#x1B[39;49;00m], ...]]#x1B[90m#x1B[39;49;00m
        ] = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[33m"#x1B[39;49;00m#x1B[33mCallInfo[TResult]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Call func, wrapping the result in a CallInfo.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param func:#x1B[39;49;00m
    #x1B[33m        The function to call. Called without arguments.#x1B[39;49;00m
    #x1B[33m    :param when:#x1B[39;49;00m
    #x1B[33m        The phase in which the function is called.#x1B[39;49;00m
    #x1B[33m    :param reraise:#x1B[39;49;00m
    #x1B[33m        Exception or exceptions that shall propagate if raised by the#x1B[39;49;00m
    #x1B[33m        function, instead of being wrapped in the CallInfo.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        excinfo = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        start = timing.time()#x1B[90m#x1B[39;49;00m
        precise_start = timing.perf_counter()#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           result: Optional[TResult] = func()#x1B[90m#x1B[39;49;00m

cls        = <class '_pytest.runner.CallInfo'>
duration   = 0.0024214000000029046
excinfo    = <ExceptionInfo PytestUnraisableExceptionWarning('Exception ignored in: <socket.socket fd=-1, family=AddressFamily.AF_I...F_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=(\'127.0.0.1\', 60077), raddr=(\'127.0.0.1\', 60078)>\n') tblen=12>
func       = <function call_and_report.<locals>.<lambda> at 0x0000023600AA6EF0>
precise_start = 1045.6844673
precise_stop = 1045.6868887
reraise    = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
result     = None
start      = 1745542434.5505934
stop       = 1745542434.5662088
when       = 'call'

#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\runner.py#x1B[0m:340: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\runner.py#x1B[0m:240: in <lambda>
    #x1B[0m#x1B[94mlambda#x1B[39;49;00m: runtest_hook(item=item, **kwds), when=when, reraise=reraise#x1B[90m#x1B[39;49;00m
        item       = <TestCaseFunction test_cookie_not_expired_when_added_after_removal>
        kwds       = {}
        runtest_hook = <HookCaller 'pytest_runtest_call'>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\pluggy\_hooks.py#x1B[0m:513: in __call__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._hookexec(#x1B[96mself#x1B[39;49;00m.name, #x1B[96mself#x1B[39;49;00m._hookimpls.copy(), kwargs, firstresult)#x1B[90m#x1B[39;49;00m
        firstresult = False
        kwargs     = {'item': <TestCaseFunction test_cookie_not_expired_when_added_after_removal>}
        self       = <HookCaller 'pytest_runtest_call'>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\pluggy\_manager.py#x1B[0m:120: in _hookexec
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._inner_hookexec(hook_name, methods, kwargs, firstresult)#x1B[90m#x1B[39;49;00m
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': <TestCaseFunction test_cookie_not_expired_when_added_after_removal>}
        methods    = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from 'C:\\hostedtoolcache\\windows\\Python\\3.10.11\\... from 'C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\lib\\site-packages\\_pytest\\unraisableexception.py'>>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x0000023673A569E0>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\threadexception.py#x1B[0m:87: in pytest_runtest_call
    #x1B[0m#x1B[94myield from#x1B[39;49;00m thread_exception_runtest_hook()#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\threadexception.py#x1B[0m:63: in thread_exception_runtest_hook
    #x1B[0m#x1B[94myield#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x0000023600884DF0>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\unraisableexception.py#x1B[0m:90: in pytest_runtest_call
    #x1B[0m#x1B[94myield from#x1B[39;49;00m unraisable_exception_runtest_hook()#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92munraisable_exception_runtest_hook#x1B[39;49;00m() -> Generator[#x1B[94mNone#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m]:#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m catch_unraisable_exception() #x1B[94mas#x1B[39;49;00m cm:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94myield#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mfinally#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m cm.unraisable:#x1B[90m#x1B[39;49;00m
                    #x1B[94mif#x1B[39;49;00m cm.unraisable.err_msg #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                        err_msg = cm.unraisable.err_msg#x1B[90m#x1B[39;49;00m
                    #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                        err_msg = #x1B[33m"#x1B[39;49;00m#x1B[33mException ignored in#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00merr_msg#x1B[33m}#x1B[39;49;00m#x1B[33m: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mcm.unraisable.object#x1B[33m!r}#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    msg += #x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m.join(#x1B[90m#x1B[39;49;00m
                        traceback.format_exception(#x1B[90m#x1B[39;49;00m
                            cm.unraisable.exc_type,#x1B[90m#x1B[39;49;00m
                            cm.unraisable.exc_value,#x1B[90m#x1B[39;49;00m
                            cm.unraisable.exc_traceback,#x1B[90m#x1B[39;49;00m
                        )#x1B[90m#x1B[39;49;00m
                    )#x1B[90m#x1B[39;49;00m
>                   warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE                   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <socket.socket fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>#x1B[0m
#x1B[1m#x1B[31mE                   #x1B[0m
#x1B[1m#x1B[31mE                   Traceback (most recent call last):#x1B[0m
#x1B[1m#x1B[31mE                     File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\asyncio\base_events.py", line 773, in _call_soon#x1B[0m
#x1B[1m#x1B[31mE                       handle = events.Handle(callback, args, self, context)#x1B[0m
#x1B[1m#x1B[31mE                   ResourceWarning: unclosed <socket.socket fd=1420, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 60077), raddr=('127.0.0.1', 60078)>#x1B[0m

cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x0000023600886B00>
err_msg    = 'Exception ignored in'
msg        = "Exception ignored in: <socket.socket fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>\n\nTr...AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 60077), raddr=('127.0.0.1', 60078)>\n"

#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\unraisableexception.py#x1B[0m:80: PytestUnraisableExceptionWarning
tests.test_connector test_named_pipe_connector_not_found
Stack Traces | 0.069s run time
#x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92m_close_event_loop#x1B[39;49;00m() -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        policy = asyncio.get_event_loop_policy()#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            loop = policy.get_event_loop()#x1B[90m#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mRuntimeError#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            loop = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m loop #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m loop.is_closed():#x1B[90m#x1B[39;49;00m
>               warnings.warn(#x1B[90m#x1B[39;49;00m
                    _UNCLOSED_EVENT_LOOP_WARNING % loop,#x1B[90m#x1B[39;49;00m
                    #x1B[96mDeprecationWarning#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                )#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE               DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop#x1B[0m
#x1B[1m#x1B[31mE               fixture: <ProactorEventLoop running=False closed=False debug=False>#x1B[0m
#x1B[1m#x1B[31mE               pytest-asyncio will close the event loop for you, but future versions of the#x1B[0m
#x1B[1m#x1B[31mE               library will no longer do so. In order to ensure compatibility with future#x1B[0m
#x1B[1m#x1B[31mE               versions, please make sure that:#x1B[0m
#x1B[1m#x1B[31mE                   1. Any custom "event_loop" fixture properly closes the loop after yielding it#x1B[0m
#x1B[1m#x1B[31mE                   2. The scopes of your custom "event_loop" fixtures do not overlap#x1B[0m
#x1B[1m#x1B[31mE                   3. Your code does not modify the event loop in async fixtures or tests#x1B[0m

loop       = <ProactorEventLoop running=False closed=True debug=False>
policy     = <asyncio.windows_events.WindowsProactorEventLoopPolicy object at 0x00000236796CDCC0>

#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\pytest_asyncio\plugin.py#x1B[0m:818: DeprecationWarning

#x1B[33mDuring handling of the above exception, another exception occurred:#x1B[0m

cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x000002360063DB40>
when = 'teardown'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

    #x1B[0m#x1B[37m@classmethod#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mfrom_call#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        #x1B[96mcls#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        func: Callable[[], TResult],#x1B[90m#x1B[39;49;00m
        when: Literal[#x1B[33m"#x1B[39;49;00m#x1B[33mcollect#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33msetup#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mcall#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33mteardown#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m],#x1B[90m#x1B[39;49;00m
        reraise: Optional[#x1B[90m#x1B[39;49;00m
            Union[Type[#x1B[96mBaseException#x1B[39;49;00m], Tuple[Type[#x1B[96mBaseException#x1B[39;49;00m], ...]]#x1B[90m#x1B[39;49;00m
        ] = #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> #x1B[33m"#x1B[39;49;00m#x1B[33mCallInfo[TResult]#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""Call func, wrapping the result in a CallInfo.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    :param func:#x1B[39;49;00m
    #x1B[33m        The function to call. Called without arguments.#x1B[39;49;00m
    #x1B[33m    :param when:#x1B[39;49;00m
    #x1B[33m        The phase in which the function is called.#x1B[39;49;00m
    #x1B[33m    :param reraise:#x1B[39;49;00m
    #x1B[33m        Exception or exceptions that shall propagate if raised by the#x1B[39;49;00m
    #x1B[33m        function, instead of being wrapped in the CallInfo.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        excinfo = #x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        start = timing.time()#x1B[90m#x1B[39;49;00m
        precise_start = timing.perf_counter()#x1B[90m#x1B[39;49;00m
        #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>           result: Optional[TResult] = func()#x1B[90m#x1B[39;49;00m

cls        = <class '_pytest.runner.CallInfo'>
duration   = 0.0631473000000824
excinfo    = <ExceptionInfo PytestUnraisableExceptionWarning('Exception ignored in: <socket.socket fd=-1, family=AddressFamily.AF_I...F_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=(\'127.0.0.1\', 59884), raddr=(\'127.0.0.1\', 59885)>\n') tblen=11>
func       = <function call_and_report.<locals>.<lambda> at 0x000002360063DB40>
precise_start = 1039.7753636
precise_stop = 1039.8385109
reraise    = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
result     = None
start      = 1745542428.6562538
stop       = 1745542428.7187495
when       = 'teardown'

#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\runner.py#x1B[0m:340: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\runner.py#x1B[0m:240: in <lambda>
    #x1B[0m#x1B[94mlambda#x1B[39;49;00m: runtest_hook(item=item, **kwds), when=when, reraise=reraise#x1B[90m#x1B[39;49;00m
        item       = <Coroutine test_named_pipe_connector_not_found>
        kwds       = {'nextitem': <Coroutine test_named_pipe_connector_permission>}
        runtest_hook = <HookCaller 'pytest_runtest_teardown'>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\pluggy\_hooks.py#x1B[0m:513: in __call__
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._hookexec(#x1B[96mself#x1B[39;49;00m.name, #x1B[96mself#x1B[39;49;00m._hookimpls.copy(), kwargs, firstresult)#x1B[90m#x1B[39;49;00m
        firstresult = False
        kwargs     = {'item': <Coroutine test_named_pipe_connector_not_found>, 'nextitem': <Coroutine test_named_pipe_connector_permission>}
        self       = <HookCaller 'pytest_runtest_teardown'>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\pluggy\_manager.py#x1B[0m:120: in _hookexec
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m._inner_hookexec(hook_name, methods, kwargs, firstresult)#x1B[90m#x1B[39;49;00m
        firstresult = False
        hook_name  = 'pytest_runtest_teardown'
        kwargs     = {'item': <Coroutine test_named_pipe_connector_not_found>, 'nextitem': <Coroutine test_named_pipe_connector_permission>}
        methods    = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from 'C:\\hostedtoolcache\\windows\\Python\\3.10.11\\...xception' from 'C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\lib\\site-packages\\_pytest\\threadexception.py'>>]
        self       = <_pytest.config.PytestPluginManager object at 0x0000023673A569E0>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\threadexception.py#x1B[0m:92: in pytest_runtest_teardown
    #x1B[0m#x1B[94myield from#x1B[39;49;00m thread_exception_runtest_hook()#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\threadexception.py#x1B[0m:63: in thread_exception_runtest_hook
    #x1B[0m#x1B[94myield#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x0000023600ADB970>
#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\unraisableexception.py#x1B[0m:95: in pytest_runtest_teardown
    #x1B[0m#x1B[94myield from#x1B[39;49;00m unraisable_exception_runtest_hook()#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92munraisable_exception_runtest_hook#x1B[39;49;00m() -> Generator[#x1B[94mNone#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m, #x1B[94mNone#x1B[39;49;00m]:#x1B[90m#x1B[39;49;00m
        #x1B[94mwith#x1B[39;49;00m catch_unraisable_exception() #x1B[94mas#x1B[39;49;00m cm:#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94myield#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mfinally#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m cm.unraisable:#x1B[90m#x1B[39;49;00m
                    #x1B[94mif#x1B[39;49;00m cm.unraisable.err_msg #x1B[95mis#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                        err_msg = cm.unraisable.err_msg#x1B[90m#x1B[39;49;00m
                    #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                        err_msg = #x1B[33m"#x1B[39;49;00m#x1B[33mException ignored in#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00merr_msg#x1B[33m}#x1B[39;49;00m#x1B[33m: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mcm.unraisable.object#x1B[33m!r}#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m\n#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
                    msg += #x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m.join(#x1B[90m#x1B[39;49;00m
                        traceback.format_exception(#x1B[90m#x1B[39;49;00m
                            cm.unraisable.exc_type,#x1B[90m#x1B[39;49;00m
                            cm.unraisable.exc_value,#x1B[90m#x1B[39;49;00m
                            cm.unraisable.exc_traceback,#x1B[90m#x1B[39;49;00m
                        )#x1B[90m#x1B[39;49;00m
                    )#x1B[90m#x1B[39;49;00m
>                   warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE                   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <socket.socket fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>#x1B[0m
#x1B[1m#x1B[31mE                   #x1B[0m
#x1B[1m#x1B[31mE                   Traceback (most recent call last):#x1B[0m
#x1B[1m#x1B[31mE                     File "D:\a\aiohttp\aiohttp\tests\conftest.py", line 248, in proactor_loop#x1B[0m
#x1B[1m#x1B[31mE                       gc.collect()#x1B[0m
#x1B[1m#x1B[31mE                   ResourceWarning: unclosed <socket.socket fd=1436, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 59884), raddr=('127.0.0.1', 59885)>#x1B[0m

cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x0000023600A61630>
err_msg    = 'Exception ignored in'
msg        = "Exception ignored in: <socket.socket fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>\n\nTr...AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 59884), raddr=('127.0.0.1', 59885)>\n"

#x1B[1m#x1B[31mC:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\_pytest\unraisableexception.py#x1B[0m:80: PytestUnraisableExceptionWarning

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@webknjaz
Copy link
Member

Missing change log?

@Dreamsorcerer Dreamsorcerer marked this pull request as draft April 22, 2025 11:55
@@ -39,7 +39,8 @@
uvloop = None # type: ignore[assignment]


pytest_plugins = ("aiohttp.pytest_plugin", "pytester")
pytest_plugins = ("pytest_asyncio", "pytest_aiohttp", "pytester")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pytest_plugins = ("pytest_asyncio", "pytest_aiohttp", "pytester")
pytest_plugins = ("pytester",)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally intended to add pytest_aiohttp to enforce it as a required plugin. Might help downstream packagers avoid getting confused by the change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could just add a changelog fragment..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could do both...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add a code comment explaining the motivation.

Copy link

codspeed-hq bot commented Apr 23, 2025

CodSpeed Performance Report

Merging #10762 will not alter performance

Comparing drop-pytest-plugin (f1f3a76) with master (46b557a)

Summary

✅ 7 untouched benchmarks
🆕 57 new benchmarks
⁉️ 51 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
⁉️ test_get_request_with_251308_compressed_chunked_payload[isal.isal_zlib-pyloop] 69.5 ms N/A N/A
🆕 test_get_request_with_251308_compressed_chunked_payload[isal.isal_zlib] N/A 69.5 ms N/A
⁉️ test_get_request_with_251308_compressed_chunked_payload[zlib-pyloop] 426.6 ms N/A N/A
🆕 test_get_request_with_251308_compressed_chunked_payload[zlib] N/A 426.6 ms N/A
⁉️ test_get_request_with_251308_compressed_chunked_payload[zlib_ng.zlib_ng-pyloop] 234.7 ms N/A N/A
🆕 test_get_request_with_251308_compressed_chunked_payload[zlib_ng.zlib_ng] N/A 235.3 ms N/A
🆕 test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload N/A 96.6 ms N/A
🆕 test_one_hundred_get_requests_with_1024_chunked_payload N/A 35.2 ms N/A
⁉️ test_one_hundred_get_requests_with_1024_chunked_payload[pyloop] 35.4 ms N/A N/A
🆕 test_one_hundred_get_requests_with_1024_content_length_payload N/A 34.7 ms N/A
⁉️ test_one_hundred_get_requests_with_1024_content_length_payload[pyloop] 34.8 ms N/A N/A
🆕 test_one_hundred_get_requests_with_30000_chunked_payload N/A 40.2 ms N/A
⁉️ test_one_hundred_get_requests_with_30000_chunked_payload[pyloop] 40.4 ms N/A N/A
🆕 test_one_hundred_get_requests_with_30000_content_length_payload N/A 38.9 ms N/A
⁉️ test_one_hundred_get_requests_with_30000_content_length_payload[pyloop] 39 ms N/A N/A
🆕 test_one_hundred_get_requests_with_512kib_chunked_payload N/A 166.1 ms N/A
🆕 test_one_hundred_get_requests_with_512kib_content_length_payload N/A 164.4 ms N/A
⁉️ test_one_hundred_get_requests_with_512kib_content_length_payload[pyloop] 164.3 ms N/A N/A
🆕 test_one_hundred_json_post_requests N/A 38.2 ms N/A
⁉️ test_one_hundred_json_post_requests[pyloop] 38.2 ms N/A N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip Skip backport bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants