New paste Repaste Download
cls = <class '_pytest.runner.CallInfo'>
func = <function FlakyPlugin.call_and_report.<locals>._call_runtest_hook.<locals>.<lambda> at 0x0000020EC99D6A20>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.
    
        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :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
        instant = timing.Instant()
        try:
>           result: TResult | None = func()
                                     ^^^^^^
venv\Lib\site-packages\_pytest\runner.py:353:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>       lambda: ihook(item=item, **kwds), when=when, reraise=reraise
                ^^^^^^^^^^^^^^^^^^^^^^^^
    )
venv\Lib\site-packages\flaky\flaky_pytest_plugin.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <HookCaller 'pytest_runtest_call'>
kwargs = {'item': <Function test_native_attach[3.10]>}, firstresult = False
    def __call__(self, **kwargs: object) -> Any:
        """Call the hook.
    
        Only accepts keyword arguments, which should match the hook
        specification.
    
        Returns the result(s) of calling all registered plugins, see
        :ref:`calling`.
        """
        assert not self.is_historic(), (
            "Cannot directly call a historic hook - use call_historic instead."
        )
        self._verify_all_args_are_provided(kwargs)
        firstresult = self.spec.opts.get("firstresult", False) if self.spec else False
        # Copy because plugins may register other plugins during iteration (#438).
>       return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\pluggy\_hooks.py:512:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x0000020EC6A4A180>
hook_name = 'pytest_runtest_call'
methods = [<HookImpl plugin_name='threadexception', plugin=<module '_pytest.threadexception' from 'D:\\a\\austin\\austin\\venv\\...e=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>>]
kwargs = {'item': <Function test_native_attach[3.10]>}, firstresult = False
    def _hookexec(
        self,
        hook_name: str,
        methods: Sequence[HookImpl],
        kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        # called from all hookcaller instances.
        # enable_tracing will set its own wrapping function at self._inner_hookexec
>       return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\pluggy\_manager.py:120:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='threadexception', plugin=<module '_pytest.threadexception' from 'D:\\a\\austin\\austin\\venv\\...e=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>>]
caller_kwargs = {'item': <Function test_native_attach[3.10]>}
firstresult = False
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
                        res = hook_impl.function(*args)
                        if res is not None:
                            results.append(res)
                            if firstresult:  # halt further impl calls
                                break
            except BaseException as exc:
                exception = exc
        finally:
            if firstresult:  # first result hooks return a single value
                result = results[0] if results else None
            else:
                result = results
    
            # run all wrapper post-yield blocks
            for teardown in reversed(teardowns):
                try:
                    if exception is not None:
                        try:
                            teardown.throw(exception)
                        except RuntimeError as re:
                            # StopIteration from generator causes RuntimeError
                            # even for coroutine usage - see #544
                            if (
                                isinstance(exception, StopIteration)
                                and re.__cause__ is exception
                            ):
                                teardown.close()
                                continue
                            else:
                                raise
                    else:
                        teardown.send(result)
                    # Following is unreachable for a well behaved hook wrapper.
                    # Try to force finalizers otherwise postponed till GC action.
                    # Note: close() may raise if generator handles GeneratorExit.
                    teardown.close()
                except StopIteration as si:
                    result = si.value
                    exception = None
                    continue
                except BaseException as e:
                    exception = e
                    continue
                _raise_wrapfail(teardown, "has second yield")
    
        if exception is not None:
>           raise exception
venv\Lib\site-packages\pluggy\_callers.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='threadexception', plugin=<module '_pytest.threadexception' from 'D:\\a\\austin\\austin\\venv\\...e=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>>]
caller_kwargs = {'item': <Function test_native_attach[3.10]>}
firstresult = False
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
                        res = hook_impl.function(*args)
                        if res is not None:
                            results.append(res)
                            if firstresult:  # halt further impl calls
                                break
            except BaseException as exc:
                exception = exc
        finally:
            if firstresult:  # first result hooks return a single value
                result = results[0] if results else None
            else:
                result = results
    
            # run all wrapper post-yield blocks
            for teardown in reversed(teardowns):
                try:
                    if exception is not None:
                        try:
>                           teardown.throw(exception)
venv\Lib\site-packages\pluggy\_callers.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>
item = <Function test_native_attach[3.10]>
    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: nodes.Item) -> Generator[None]:
        self.log_cli_handler.set_when("call")
    
        with self._runtest_for(item, "call"):
>           yield
venv\Lib\site-packages\_pytest\logging.py:850:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='threadexception', plugin=<module '_pytest.threadexception' from 'D:\\a\\austin\\austin\\venv\\...e=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>>]
caller_kwargs = {'item': <Function test_native_attach[3.10]>}
firstresult = False
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
                        res = hook_impl.function(*args)
                        if res is not None:
                            results.append(res)
                            if firstresult:  # halt further impl calls
                                break
            except BaseException as exc:
                exception = exc
        finally:
            if firstresult:  # first result hooks return a single value
                result = results[0] if results else None
            else:
                result = results
    
            # run all wrapper post-yield blocks
            for teardown in reversed(teardowns):
                try:
                    if exception is not None:
                        try:
>                           teardown.throw(exception)
venv\Lib\site-packages\pluggy\_callers.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <CaptureManager _method='no' _global_capturing=<MultiCapture out=None err=None in_=None _state='suspended' _in_suspended=False> _capture_fixture=None>
item = <Function test_native_attach[3.10]>
    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: Item) -> Generator[None]:
        with self.item_capture("call", item):
>           return (yield)
                    ^^^^^
venv\Lib\site-packages\_pytest\capture.py:900:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='threadexception', plugin=<module '_pytest.threadexception' from 'D:\\a\\austin\\austin\\venv\\...e=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>>]
caller_kwargs = {'item': <Function test_native_attach[3.10]>}
firstresult = False
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
                        res = hook_impl.function(*args)
                        if res is not None:
                            results.append(res)
                            if firstresult:  # halt further impl calls
                                break
            except BaseException as exc:
                exception = exc
        finally:
            if firstresult:  # first result hooks return a single value
                result = results[0] if results else None
            else:
                result = results
    
            # run all wrapper post-yield blocks
            for teardown in reversed(teardowns):
                try:
                    if exception is not None:
                        try:
>                           teardown.throw(exception)
venv\Lib\site-packages\pluggy\_callers.py:139:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <Function test_native_attach[3.10]>
    @hookimpl(wrapper=True)
    def pytest_runtest_call(item: Item) -> Generator[None]:
        xfailed = item.stash.get(xfailed_key, None)
        if xfailed is None:
            item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item)
    
        if xfailed and not item.config.option.runxfail and not xfailed.run:
            xfail("[NOTRUN] " + xfailed.reason)
    
        try:
>           return (yield)
                    ^^^^^
venv\Lib\site-packages\_pytest\skipping.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_runtest_call'
hook_impls = [<HookImpl plugin_name='threadexception', plugin=<module '_pytest.threadexception' from 'D:\\a\\austin\\austin\\venv\\...e=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x0000020EC7489EE0>>]
caller_kwargs = {'item': <Function test_native_attach[3.10]>}
firstresult = False
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
>                       res = hook_impl.function(*args)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\pluggy\_callers.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <Function test_native_attach[3.10]>
    def pytest_runtest_call(item: Item) -> None:
        _update_current_test_var(item, "call")
        try:
            del sys.last_type
            del sys.last_value
            del sys.last_traceback
            if sys.version_info >= (3, 12, 0):
                del sys.last_exc  # type:ignore[attr-defined]
        except AttributeError:
            pass
        try:
>           item.runtest()
venv\Lib\site-packages\_pytest\runner.py:179:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Function test_native_attach[3.10]>
    def runtest(self) -> None:
        """Execute the underlying test function."""
>       self.ihook.pytest_pyfunc_call(pyfuncitem=self)
venv\Lib\site-packages\_pytest\python.py:1720:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <HookCaller 'pytest_pyfunc_call'>
kwargs = {'pyfuncitem': <Function test_native_attach[3.10]>}, firstresult = True
    def __call__(self, **kwargs: object) -> Any:
        """Call the hook.
    
        Only accepts keyword arguments, which should match the hook
        specification.
    
        Returns the result(s) of calling all registered plugins, see
        :ref:`calling`.
        """
        assert not self.is_historic(), (
            "Cannot directly call a historic hook - use call_historic instead."
        )
        self._verify_all_args_are_provided(kwargs)
        firstresult = self.spec.opts.get("firstresult", False) if self.spec else False
        # Copy because plugins may register other plugins during iteration (#438).
>       return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\pluggy\_hooks.py:512:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x0000020EC6A4A180>
hook_name = 'pytest_pyfunc_call'
methods = [<HookImpl plugin_name='python', plugin=<module '_pytest.python' from 'D:\\a\\austin\\austin\\venv\\Lib\\site-packages\\_pytest\\python.py'>>]
kwargs = {'pyfuncitem': <Function test_native_attach[3.10]>}, firstresult = True
    def _hookexec(
        self,
        hook_name: str,
        methods: Sequence[HookImpl],
        kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        # called from all hookcaller instances.
        # enable_tracing will set its own wrapping function at self._inner_hookexec
>       return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\pluggy\_manager.py:120:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_pyfunc_call'
hook_impls = [<HookImpl plugin_name='python', plugin=<module '_pytest.python' from 'D:\\a\\austin\\austin\\venv\\Lib\\site-packages\\_pytest\\python.py'>>]
caller_kwargs = {'pyfuncitem': <Function test_native_attach[3.10]>}
firstresult = True
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
                        res = hook_impl.function(*args)
                        if res is not None:
                            results.append(res)
                            if firstresult:  # halt further impl calls
                                break
            except BaseException as exc:
                exception = exc
        finally:
            if firstresult:  # first result hooks return a single value
                result = results[0] if results else None
            else:
                result = results
    
            # run all wrapper post-yield blocks
            for teardown in reversed(teardowns):
                try:
                    if exception is not None:
                        try:
                            teardown.throw(exception)
                        except RuntimeError as re:
                            # StopIteration from generator causes RuntimeError
                            # even for coroutine usage - see #544
                            if (
                                isinstance(exception, StopIteration)
                                and re.__cause__ is exception
                            ):
                                teardown.close()
                                continue
                            else:
                                raise
                    else:
                        teardown.send(result)
                    # Following is unreachable for a well behaved hook wrapper.
                    # Try to force finalizers otherwise postponed till GC action.
                    # Note: close() may raise if generator handles GeneratorExit.
                    teardown.close()
                except StopIteration as si:
                    result = si.value
                    exception = None
                    continue
                except BaseException as e:
                    exception = e
                    continue
                _raise_wrapfail(teardown, "has second yield")
    
        if exception is not None:
>           raise exception
venv\Lib\site-packages\pluggy\_callers.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_name = 'pytest_pyfunc_call'
hook_impls = [<HookImpl plugin_name='python', plugin=<module '_pytest.python' from 'D:\\a\\austin\\austin\\venv\\Lib\\site-packages\\_pytest\\python.py'>>]
caller_kwargs = {'pyfuncitem': <Function test_native_attach[3.10]>}
firstresult = True
    def _multicall(
        hook_name: str,
        hook_impls: Sequence[HookImpl],
        caller_kwargs: Mapping[str, object],
        firstresult: bool,
    ) -> object | list[object]:
        """Execute a call into multiple python functions/methods and return the
        result(s).
    
        ``caller_kwargs`` comes from HookCaller.__call__().
        """
        __tracebackhide__ = True
        results: list[object] = []
        exception = None
        try:  # run impl and wrapper setup functions in a loop
            teardowns: list[Teardown] = []
            try:
                for hook_impl in reversed(hook_impls):
                    try:
                        args = [caller_kwargs[argname] for argname in hook_impl.argnames]
                    except KeyError as e:
                        # coverage bug - this is tested
                        for argname in hook_impl.argnames:  # pragma: no cover
                            if argname not in caller_kwargs:
                                raise HookCallError(
                                    f"hook call must provide argument {argname!r}"
                                ) from e
    
                    if hook_impl.hookwrapper:
                        function_gen = run_old_style_hookwrapper(hook_impl, hook_name, args)
    
                        next(function_gen)  # first yield
                        teardowns.append(function_gen)
    
                    elif hook_impl.wrapper:
                        try:
                            # If this cast is not valid, a type error is raised below,
                            # which is the desired response.
                            res = hook_impl.function(*args)
                            function_gen = cast(Generator[None, object, object], res)
                            next(function_gen)  # first yield
                            teardowns.append(function_gen)
                        except StopIteration:
                            _raise_wrapfail(function_gen, "did not yield")
                    else:
>                       res = hook_impl.function(*args)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\pluggy\_callers.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyfuncitem = <Function test_native_attach[3.10]>
    @hookimpl(trylast=True)
    def pytest_pyfunc_call(pyfuncitem: Function) -> object | None:
        testfunction = pyfuncitem.obj
        if is_async_function(testfunction):
            async_fail(pyfuncitem.nodeid)
        funcargs = pyfuncitem.funcargs
        testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames}
>       result = testfunction(**testargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^
venv\Lib\site-packages\_pytest\python.py:166:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
py = '3.10'
save_mojo = <function save_mojo.<locals>._save at 0x0000020EC99D6020>
    @requires_sudo
    @allpythons()
    def test_native_attach(py, save_mojo):
        """Native mode works when attaching to an already-running process."""
        with run_python(py, target("sleepy.py"), "2") as p:
            sleep(0.5)
            result = austin("-n", "-i", "2ms", "-p", str(p.pid))
        save_mojo(result.stdout)
        assert result.returncode == 0, result.stderr or result.stdout
    
>       assert has_frame(
            result.samples, filename="sleepy.py", function="<module>"
        ), "Expected Python frame from sleepy.py in attach mode"
E       AssertionError: Expected Python frame from sleepy.py in attach mode
E       assert False
E        +  where False = has_frame([AustinSample(pid=7456, iid=0, thread='1d18', metrics=AustinMetrics(time=53, memory=None), frames=(AustinFrame(filename='C:\\Windows\\SYSTEM32\\ntdll.dll', function='RtlUserThreadStart', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\System32\\KERNEL32.DLL', function='BaseThreadInitThunk', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python.exe', function='<unknown>', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_Main', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_RunMain', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_RunMain', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_MakePendingCalls', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolc..., AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='PyTraceBack_Print', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\System32\\KERNELBASE.dll', function='WaitForSingleObjectEx', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\SYSTEM32\\ntdll.dll', function='NtWaitForSingleObject', line=0, line_end=0, column=0, column_end=0)), gc=None, idle=None), AustinSample(pid=7456, iid=0, thread='1d18', metrics=AustinMetrics(time=2561, memory=None), frames=(AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='PyTraceBack_Print', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='PyTraceBack_Print', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\System32\\KERNELBASE.dll', function='WaitForSingleObjectEx', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\SYSTEM32\\ntdll.dll', function='NtWaitForSingleObject', line=0, line_end=0, column=0, column_end=0)), gc=None, idle=None), ...], filename='sleepy.py', function='<module>')
E        +    where [AustinSample(pid=7456, iid=0, thread='1d18', metrics=AustinMetrics(time=53, memory=None), frames=(AustinFrame(filename='C:\\Windows\\SYSTEM32\\ntdll.dll', function='RtlUserThreadStart', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\System32\\KERNEL32.DLL', function='BaseThreadInitThunk', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python.exe', function='<unknown>', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_Main', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_RunMain', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_RunMain', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='Py_MakePendingCalls', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolc..., AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='PyTraceBack_Print', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\System32\\KERNELBASE.dll', function='WaitForSingleObjectEx', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\SYSTEM32\\ntdll.dll', function='NtWaitForSingleObject', line=0, line_end=0, column=0, column_end=0)), gc=None, idle=None), AustinSample(pid=7456, iid=0, thread='1d18', metrics=AustinMetrics(time=2561, memory=None), frames=(AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='PyTraceBack_Print', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll', function='PyTraceBack_Print', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\System32\\KERNELBASE.dll', function='WaitForSingleObjectEx', line=0, line_end=0, column=0, column_end=0), AustinFrame(filename='C:\\Windows\\SYSTEM32\\ntdll.dll', function='NtWaitForSingleObject', line=0, line_end=0, column=0, column_end=0)), gc=None, idle=None), ...] = CompletedProcess(args=['src\\austin.exe', '-n', '-i', '2ms', '-p', '7408'], returncode=0, stdout=b'MOJ\x04\x01austin\x004.1.0\x00\x01interval\x002000\x00\x01mode\x00wall\x00\x01python\x003.10.11\x00\x02\xa0t\x001d18\x00\x0b\x94\xf6\x90\x1fC:\\Windows\\SYSTEM32\\ntdll.dll\x00\x0b\x95\xf6\x90\x1fNtWaitForSingleObject\x00\x03\x94\xf6\x90\x9f\xad\xff?\x94\xf6\x90\x1f\x95\xf6\x90\x1f\x00\x00\x00\x00\x0b\x9f\xf1\xaduC:\\Windows\\System32\\KERNELBASE.dll\x00\x0b\xa0\xf1\xaduWaitForSingleObjectEx\x00\x03\x9f\xf1\xad\xf5\xac\xff?\x9f\xf1\xadu\xa0\xf1\xadu\x00\x00\x00\x00\x0b\xa8\xdd\xf0PC:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll\x00\x0b\xa9\xdd\xf0PPyTraceBack_Print\x00\x03\xa8\xdd\xf0\xd0\xa5\xff?\xa8\xdd\xf0P\xa9\xdd\xf0P\x00\x00\x00\x00\x0b\xb5\xd9\xf0PC:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll\x00\x0b\xb6\xd9\xf0PPyTraceBack_Print\x00\x03\xb5\xd9\xf0\xd0\xa5\xff?\xb5\xd9\xf0P\xb6\xd9\xf0P\x00\x00\x00\x00\x0b\x82\xd0\x8cPC:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\python310.dll\x00\x0b\x83\xd0\x8cPPyEval_EvalFrameDefault\x00\x03\x82\xd0\x8c\xd0\xa5\xff?\x82\xd0\x8cP\x83\xd0\x8cP\x00\x00\x00\x00\x0b\x8d\x87\xe5OC:\\hostedtoolcache\\w...ws\\Python\\3.10.11\\x64\\python310.dll\x00\x0b\x98\xce\xd7PPyRun_SimpleFileObject\x00\x03\x97\xce\xd7\xd0\xa5\xff?\x97\xce\xd7P\x98\xce\xd7P\x00\x00\x00\x00\x05\xbc\x94\xa6\x9e\xad\xff?\x05\x97\xa3\xb7\x84\xad\xff?\x05\xb0\xc8\x90\xfa\xe7\xfd?\x05\x99\xcb\x91\xd0\xa5\xff?\x05\x81\xe3\x91\xd0\xa5\xff?\x05\xb0\xe8\x91\xd0\xa5\xff?\x05\x9f\xe1\xd6\xd0\xa5\xff?\x05\xa3\xe6\xd6\xd0\xa5\xff?\x05\xa0\xf4\xd6\xd0\xa5\xff?\x05\x89\xc9\xd7\xd0\xa5\xff?\x05\x97\xce\xd7\xd0\xa5\xff?\t\xbe\'\x01count\x001373\x00\x01duration\x003647583\x00\x01sampling\x0063,157,3522\x00\x01saturation\x003/1373\x00\x01errors\x0021/1373\x00', stderr="\x1b[1m              _   _      \x1b[0m\r\n\x1b[1m __ _ _  _ __| |_(_)_ _  \x1b[0m\r\n\x1b[1m/ _` | || (_-<  _| | ' \\ \x1b[0m\r\n\x1b[1m\\__,_|\\_,_/__/\\__|_|_||_|\x1b[0m \x1b[1;36m4.1.0\x1b[0m [gcc 15.2.0]\r\n\r\nšŸ \x1b[1mPython\x1b[0m version: \x1b[1;33m3.10.11\x1b[0m\r\n\r\nšŸ“ˆ \x1b[1mSampling Statistics\x1b[0m\r\n\r\n      Total duration\x1b[0;30m . . . . . . \x1b[0m\x1b[1m3.65s\x1b[0m\r\n      Average sampling rate\x1b[0;30m  . . \x1b[0m\x1b[1m376.41 Hz\x1b[0m\r\n      Error rate\x1b[0;30m . . . . . . . . \x1b[0m\x1b[1m21/1373\x1b[0m (\x1b[1m1.53%\x1b[0m)\r\n").samples
test\functional\test_native.py:205: AssertionError
Filename: None. Size: 40kb. View raw, , hex, or download this file.

This paste expires on 2026-05-19 14:34:07.373325+00:00. Pasted through deprecated-web.