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 79 commits into
base: master
Choose a base branch
from
Draft

Remove pytest_plugin #10762

wants to merge 79 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

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3471 1 3470 72
View the top 1 failed test(s) by shortest run time
tests.test_proxy.TestProxy::test_connect
Stack Traces | 0.049s run time
cls = <class '_pytest.runner.CallInfo'>
func = <function call_and_report.<locals>.<lambda> at 0x107152660>
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.04827133399999184
excinfo    = <ExceptionInfo PytestUnraisableExceptionWarning('Exception ignored in: <socket.socket fd=-1, family=1, type=1, proto=0...in tearDown\n    gc.collect()\nResourceWarning: unclosed <socket.socket fd=21, family=1, type=1, proto=0>\n') tblen=12>
func       = <function call_and_report.<locals>.<lambda> at 0x107152660>
precise_start = 437.803573791
precise_stop = 437.851845125
reraise    = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
result     = None
start      = 1746489360.522411
stop       = 1746489360.57071
when       = 'call'

#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11....../site-packages/_pytest/runner.py#x1B[0m:340: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11....../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_connect>
        kwds       = {}
        runtest_hook = <HookCaller 'pytest_runtest_call'>
#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11.../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_connect>}
        self       = <HookCaller 'pytest_runtest_call'>
#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11.../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_connect>}
        methods    = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '....../Library/Frameworks/Python.framework/Versions/3........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11........./site-packages/_pytest/unraisableexception.py'>>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x1015e1b90>
#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11....../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[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11....../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 0x1070c7c10>
#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11........./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=1, type=1, 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 ".../aiohttp/tests/test_proxy.py", line 36, in tearDown#x1B[0m
#x1B[1m#x1B[31mE                       gc.collect()#x1B[0m
#x1B[1m#x1B[31mE                   ResourceWarning: unclosed <socket.socket fd=21, family=1, type=1, proto=0>#x1B[0m

cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x107066350>
err_msg    = 'Exception ignored in'
msg        = 'Exception ignored in: <socket.socket fd=-1, family=1, type=1, proto=0>\n\nTraceback (most recent call last):\n  File ..., line 36, in tearDown\n    gc.collect()\nResourceWarning: unclosed <socket.socket fd=21, family=1, type=1, proto=0>\n'

#x1B[1m#x1B[........./Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11........./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
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