Source: python-watchgod
Version: 0.8.2-2
Severity: serious
X-Debbugs-CC: python-an...@packages.debian.org
Tags: sid trixie
User: debian...@lists.debian.org
Usertags: needs-update
Control: affects -1 src:python-anyio

Dear maintainer(s),

[I note that python-watchgod has been requested for removal, but it has a big chain of reverse dependencies, so this bug is mostly to warn them, as it will trigger autoremoval from testing of python-watchgod and these reverse dependencies.]

With a recent upload of python-anyio the autopkgtest of python-watchgod fails in testing when that autopkgtest is run with the binary packages of python-anyio from unstable. It passes when run with only packages from testing. In tabular form:

                       pass            fail
python-anyio           from testing    4.2.0-1
python-watchgod        from testing    0.8.2-2
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of python-anyio to testing [1]. Of course, python-anyio shouldn't just break your autopkgtest (or even worse, your package), but it seems to me that the change in python-anyio was intended and your package needs to update to the new situation.

If this is a real problem in your package (and not only in your autopkgtest), the right binary package(s) from python-anyio should really add a versioned Breaks on the unfixed version of (one of your) package(s). Note: the Breaks is nice even if the issue is only in the autopkgtest as it helps the migration software to figure out the right versions to combine in the tests.

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=python-anyio

https://ci.debian.net/data/autopkgtest/testing/arm64/p/python-watchgod/42699299/log.gz

=================================== FAILURES =================================== 57s _________________ test_async_alive_terminates[asyncio+uvloop] __________________ 57s 57s pyfuncitem = <Function test_async_alive_terminates[asyncio+uvloop]>
 57s  57s     @pytest.hookimpl(tryfirst=True)
 57s     def pytest_pyfunc_call(pyfuncitem: Any) -> bool | None:
 57s         def run_with_hypothesis(**kwargs: Any) -> None:
 57s             with get_runner(backend_name, backend_options) as runner:
 57s                 runner.run_test(original_func, kwargs)
 57s      57s         backend = pyfuncitem.funcargs.get("anyio_backend")
 57s         if backend:
57s backend_name, backend_options = extract_backend_and_options(backend)
 57s      57s             if hasattr(pyfuncitem.obj, "hypothesis"):
57s # Wrap the inner test function unless it's already wrapped
 57s                 original_func = pyfuncitem.obj.hypothesis.inner_test
57s if original_func.__qualname__ != run_with_hypothesis.__qualname__:
 57s                     if iscoroutinefunction(original_func):
57s pyfuncitem.obj.hypothesis.inner_test = run_with_hypothesis
 57s      57s                 return None
 57s      57s             if iscoroutinefunction(pyfuncitem.obj):
 57s                 funcargs = pyfuncitem.funcargs
57s testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} 57s > with get_runner(backend_name, backend_options) as runner: 57s 57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:123: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3.11/contextlib.py:137: in __enter__
 57s     return next(self.gen)
57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:45: in get_runner
 57s     asynclib.create_test_runner(backend_options)
57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:2465: in create_test_runner
 57s     return TestRunner(**options)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s self = <anyio._backends._asyncio.TestRunner object at 0xffff9513e590>
 57s  57s     def __init__(
 57s         self,
 57s         *,
 57s         debug: bool | None = None,
 57s         use_uvloop: bool = False,
 57s         loop_factory: Callable[[], AbstractEventLoop] | None = None,
 57s     ) -> None:
 57s         if use_uvloop and loop_factory is None:
 57s >           import uvloop
 57s E           ModuleNotFoundError: No module named 'uvloop'
57s 57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:1837: ModuleNotFoundError 57s __________________________ test_watch[asyncio+uvloop] __________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff95199050>
 57s  57s     def test_watch(mocker):
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self._results = iter(
 57s                     [
 57s                         {'r1'},
 57s                         set(),
 57s                         {'r2'},
 57s                         set(),
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
57s 57s iter_ = watch('xxx', watcher_cls=FakeWatcher, debounce=5, normal_sleep=2, min_sleep=1)
 57s >       assert next(iter_) == {'r1'}
57s 57s tests/test_watch.py:310: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff95021230>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _____________________________ test_watch[asyncio] ______________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff950cea10>
 57s  57s     def test_watch(mocker):
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self._results = iter(
 57s                     [
 57s                         {'r1'},
 57s                         set(),
 57s                         {'r2'},
 57s                         set(),
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
57s 57s iter_ = watch('xxx', watcher_cls=FakeWatcher, debounce=5, normal_sleep=2, min_sleep=1)
 57s >       assert next(iter_) == {'r1'}
57s 57s tests/test_watch.py:310: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475d9a0>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _______________________________ test_watch[trio] _______________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff9528f850>
 57s  57s     def test_watch(mocker):
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self._results = iter(
 57s                     [
 57s                         {'r1'},
 57s                         set(),
 57s                         {'r2'},
 57s                         set(),
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
57s 57s iter_ = watch('xxx', watcher_cls=FakeWatcher, debounce=5, normal_sleep=2, min_sleep=1)
 57s >       assert next(iter_) == {'r1'}
57s 57s tests/test_watch.py:310: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475e5e0>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s __________________ test_watch_watcher_kwargs[asyncio+uvloop] ___________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff951dd050>
 57s  57s     def test_watch_watcher_kwargs(mocker):
 57s         class FakeWatcher:
 57s             def __init__(self, path, arg1=None, arg2=None):
 57s                 self._results = iter(
 57s                     [
 57s                         {arg1},
 57s                         set(),
 57s                         {arg2},
 57s                         set(),
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
 57s      57s         kwargs = dict(arg1='foo', arg2='bar')
57s 57s iter_ = watch('xxx', watcher_cls=FakeWatcher, watcher_kwargs=kwargs, debounce=5, normal_sleep=2, min_sleep=1)
 57s >       assert next(iter_) == {kwargs['arg1']}
57s 57s tests/test_watch.py:332: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475eb90>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s ______________________ test_watch_watcher_kwargs[asyncio] ______________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff95070390>
 57s  57s     def test_watch_watcher_kwargs(mocker):
 57s         class FakeWatcher:
 57s             def __init__(self, path, arg1=None, arg2=None):
 57s                 self._results = iter(
 57s                     [
 57s                         {arg1},
 57s                         set(),
 57s                         {arg2},
 57s                         set(),
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
 57s      57s         kwargs = dict(arg1='foo', arg2='bar')
57s 57s iter_ = watch('xxx', watcher_cls=FakeWatcher, watcher_kwargs=kwargs, debounce=5, normal_sleep=2, min_sleep=1)
 57s >       assert next(iter_) == {kwargs['arg1']}
57s 57s tests/test_watch.py:332: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475f290>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _______________________ test_watch_watcher_kwargs[trio] ________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff952c75d0>
 57s  57s     def test_watch_watcher_kwargs(mocker):
 57s         class FakeWatcher:
 57s             def __init__(self, path, arg1=None, arg2=None):
 57s                 self._results = iter(
 57s                     [
 57s                         {arg1},
 57s                         set(),
 57s                         {arg2},
 57s                         set(),
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
 57s      57s         kwargs = dict(arg1='foo', arg2='bar')
57s 57s iter_ = watch('xxx', watcher_cls=FakeWatcher, watcher_kwargs=kwargs, debounce=5, normal_sleep=2, min_sleep=1)
 57s >       assert next(iter_) == {kwargs['arg1']}
57s 57s tests/test_watch.py:332: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475fa70>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _______________________ test_watch_stop[asyncio+uvloop] ________________________
 57s  57s     def test_watch_stop():
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self._results = iter(
 57s                     [
 57s                         {'r1'},
 57s                         set(),
 57s                         {'r2'},
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
 57s      57s         stop_event = threading.Event()
 57s         stop_event.set()
 57s         ans = []
57s > for c in watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=1, stop_event=stop_event): 57s 57s tests/test_watch.py:353: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475e9d0>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s ___________________________ test_watch_stop[asyncio] ___________________________
 57s  57s     def test_watch_stop():
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self._results = iter(
 57s                     [
 57s                         {'r1'},
 57s                         set(),
 57s                         {'r2'},
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
 57s      57s         stop_event = threading.Event()
 57s         stop_event.set()
 57s         ans = []
57s > for c in watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=1, stop_event=stop_event): 57s 57s tests/test_watch.py:353: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9475f840>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s ____________________________ test_watch_stop[trio] _____________________________
 57s  57s     def test_watch_stop():
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self._results = iter(
 57s                     [
 57s                         {'r1'},
 57s                         set(),
 57s                         {'r2'},
 57s                     ]
 57s                 )
 57s      57s             def check(self):
 57s                 return next(self._results)
 57s      57s         stop_event = threading.Event()
 57s         stop_event.set()
 57s         ans = []
57s > for c in watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=1, stop_event=stop_event): 57s 57s tests/test_watch.py:353: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479c740>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s __________________ test_watch_keyboard_error[asyncio+uvloop] ___________________
 57s  57s     def test_watch_keyboard_error():
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 pass
 57s      57s             def check(self):
 57s                 raise KeyboardInterrupt()
57s 57s iter = watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=1)
 57s >       assert list(iter) == []
57s 57s tests/test_watch.py:367: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479d380>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s ______________________ test_watch_keyboard_error[asyncio] ______________________
 57s  57s     def test_watch_keyboard_error():
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 pass
 57s      57s             def check(self):
 57s                 raise KeyboardInterrupt()
57s 57s iter = watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=1)
 57s >       assert list(iter) == []
57s 57s tests/test_watch.py:367: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479d310>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _______________________ test_watch_keyboard_error[trio] ________________________
 57s  57s     def test_watch_keyboard_error():
 57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 pass
 57s      57s             def check(self):
 57s                 raise KeyboardInterrupt()
57s 57s iter = watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=1)
 57s >       assert list(iter) == []
57s 57s tests/test_watch.py:367: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479d690>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s ________________________ test_watch_log[asyncio+uvloop] ________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff950378d0>
 57s caplog = <_pytest.logging.LogCaptureFixture object at 0xffff95081c50>
 57s  57s     def test_watch_log(mocker, caplog):
57s mock_log_enabled = mocker.patch('watchgod.main.logger.isEnabledFor')
 57s         mock_log_enabled.return_value = True
 57s      57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self.files = [1, 2, 3]
 57s      57s             def check(self):
 57s                 return {'r1'}
57s 57s iter = watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=10)
 57s >       assert next(iter) == {'r1'}
57s 57s tests/test_watch.py:382: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479cb30>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s ___________________________ test_watch_log[asyncio] ____________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff951cc590>
 57s caplog = <_pytest.logging.LogCaptureFixture object at 0xffff95170090>
 57s  57s     def test_watch_log(mocker, caplog):
57s mock_log_enabled = mocker.patch('watchgod.main.logger.isEnabledFor')
 57s         mock_log_enabled.return_value = True
 57s      57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self.files = [1, 2, 3]
 57s      57s             def check(self):
 57s                 return {'r1'}
57s 57s iter = watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=10)
 57s >       assert next(iter) == {'r1'}
57s 57s tests/test_watch.py:382: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479eb90>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _____________________________ test_watch_log[trio] _____________________________ 57s 57s mocker = <pytest_mock.plugin.MockerFixture object at 0xffff950cf650>
 57s caplog = <_pytest.logging.LogCaptureFixture object at 0xffff950cf390>
 57s  57s     def test_watch_log(mocker, caplog):
57s mock_log_enabled = mocker.patch('watchgod.main.logger.isEnabledFor')
 57s         mock_log_enabled.return_value = True
 57s      57s         class FakeWatcher:
 57s             def __init__(self, path):
 57s                 self.files = [1, 2, 3]
 57s      57s             def check(self):
 57s                 return {'r1'}
57s 57s iter = watch('xxx', watcher_cls=FakeWatcher, debounce=5, min_sleep=10)
 57s >       assert next(iter) == {'r1'}
57s 57s tests/test_watch.py:382: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3/dist-packages/watchgod/main.py:47: in watch
 57s     yield anyio.run(_awatch.__anext__)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s func = <bound method awatch.__anext__ of <watchgod.main.awatch object at 0xffff9479f300>>
 57s backend = 'asyncio', backend_options = None, args = ()
 57s asynclib_name = 'asyncio'
 57s  57s     def run(
 57s         func: Callable[[Unpack[PosArgsT]], Awaitable[T_Retval]],
 57s         *args: Unpack[PosArgsT],
 57s         backend: str = "asyncio",
 57s         backend_options: dict[str, Any] | None = None,
 57s     ) -> T_Retval:
 57s         """
57s Run the given coroutine function in an asynchronous event loop. 57s 57s The current thread must not be already running an event loop.
 57s      57s         :param func: a coroutine function
 57s         :param args: positional arguments to ``func``
57s :param backend: name of the asynchronous event loop implementation – currently
 57s             either ``asyncio`` or ``trio``
57s :param backend_options: keyword arguments to call the backend ``run()`` 57s implementation with (documented :ref:`here <backend options>`)
 57s         :return: the return value of the coroutine function
57s :raises RuntimeError: if an asynchronous event loop is already running in this
 57s             thread
 57s         :raises LookupError: if the named backend is not found
 57s      57s         """
 57s         try:
 57s             asynclib_name = sniffio.current_async_library()
 57s         except sniffio.AsyncLibraryNotFoundError:
 57s             pass
 57s         else:
57s > raise RuntimeError(f"Already running {asynclib_name} in this thread")
 57s E           RuntimeError: Already running asyncio in this thread
57s 57s /usr/lib/python3/dist-packages/anyio/_core/_eventloop.py:58: RuntimeError 57s _________________________ test_awatch[asyncio+uvloop] __________________________
 57s  57s pyfuncitem = <Function test_awatch[asyncio+uvloop]>
 57s  57s     @pytest.hookimpl(tryfirst=True)
 57s     def pytest_pyfunc_call(pyfuncitem: Any) -> bool | None:
 57s         def run_with_hypothesis(**kwargs: Any) -> None:
 57s             with get_runner(backend_name, backend_options) as runner:
 57s                 runner.run_test(original_func, kwargs)
 57s      57s         backend = pyfuncitem.funcargs.get("anyio_backend")
 57s         if backend:
57s backend_name, backend_options = extract_backend_and_options(backend)
 57s      57s             if hasattr(pyfuncitem.obj, "hypothesis"):
57s # Wrap the inner test function unless it's already wrapped
 57s                 original_func = pyfuncitem.obj.hypothesis.inner_test
57s if original_func.__qualname__ != run_with_hypothesis.__qualname__:
 57s                     if iscoroutinefunction(original_func):
57s pyfuncitem.obj.hypothesis.inner_test = run_with_hypothesis
 57s      57s                 return None
 57s      57s             if iscoroutinefunction(pyfuncitem.obj):
 57s                 funcargs = pyfuncitem.funcargs
57s testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} 57s > with get_runner(backend_name, backend_options) as runner: 57s 57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:123: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3.11/contextlib.py:137: in __enter__
 57s     return next(self.gen)
57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:45: in get_runner
 57s     asynclib.create_test_runner(backend_options)
57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:2465: in create_test_runner
 57s     return TestRunner(**options)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s self = <anyio._backends._asyncio.TestRunner object at 0xffff95046ed0>
 57s  57s     def __init__(
 57s         self,
 57s         *,
 57s         debug: bool | None = None,
 57s         use_uvloop: bool = False,
 57s         loop_factory: Callable[[], AbstractEventLoop] | None = None,
 57s     ) -> None:
 57s         if use_uvloop and loop_factory is None:
 57s >           import uvloop
 57s E           ModuleNotFoundError: No module named 'uvloop'
57s 57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:1837: ModuleNotFoundError 57s _______________________ test_awatch_stop[asyncio+uvloop] _______________________
 57s  57s pyfuncitem = <Function test_awatch_stop[asyncio+uvloop]>
 57s  57s     @pytest.hookimpl(tryfirst=True)
 57s     def pytest_pyfunc_call(pyfuncitem: Any) -> bool | None:
 57s         def run_with_hypothesis(**kwargs: Any) -> None:
 57s             with get_runner(backend_name, backend_options) as runner:
 57s                 runner.run_test(original_func, kwargs)
 57s      57s         backend = pyfuncitem.funcargs.get("anyio_backend")
 57s         if backend:
57s backend_name, backend_options = extract_backend_and_options(backend)
 57s      57s             if hasattr(pyfuncitem.obj, "hypothesis"):
57s # Wrap the inner test function unless it's already wrapped
 57s                 original_func = pyfuncitem.obj.hypothesis.inner_test
57s if original_func.__qualname__ != run_with_hypothesis.__qualname__:
 57s                     if iscoroutinefunction(original_func):
57s pyfuncitem.obj.hypothesis.inner_test = run_with_hypothesis
 57s      57s                 return None
 57s      57s             if iscoroutinefunction(pyfuncitem.obj):
 57s                 funcargs = pyfuncitem.funcargs
57s testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} 57s > with get_runner(backend_name, backend_options) as runner: 57s 57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:123: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3.11/contextlib.py:137: in __enter__
 57s     return next(self.gen)
57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:45: in get_runner
 57s     asynclib.create_test_runner(backend_options)
57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:2465: in create_test_runner
 57s     return TestRunner(**options)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s self = <anyio._backends._asyncio.TestRunner object at 0xffff95271510>
 57s  57s     def __init__(
 57s         self,
 57s         *,
 57s         debug: bool | None = None,
 57s         use_uvloop: bool = False,
 57s         loop_factory: Callable[[], AbstractEventLoop] | None = None,
 57s     ) -> None:
 57s         if use_uvloop and loop_factory is None:
 57s >           import uvloop
 57s E           ModuleNotFoundError: No module named 'uvloop'
57s 57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:1837: ModuleNotFoundError 57s _______________________ test_awatch_log[asyncio+uvloop] ________________________
 57s  57s pyfuncitem = <Function test_awatch_log[asyncio+uvloop]>
 57s  57s     @pytest.hookimpl(tryfirst=True)
 57s     def pytest_pyfunc_call(pyfuncitem: Any) -> bool | None:
 57s         def run_with_hypothesis(**kwargs: Any) -> None:
 57s             with get_runner(backend_name, backend_options) as runner:
 57s                 runner.run_test(original_func, kwargs)
 57s      57s         backend = pyfuncitem.funcargs.get("anyio_backend")
 57s         if backend:
57s backend_name, backend_options = extract_backend_and_options(backend)
 57s      57s             if hasattr(pyfuncitem.obj, "hypothesis"):
57s # Wrap the inner test function unless it's already wrapped
 57s                 original_func = pyfuncitem.obj.hypothesis.inner_test
57s if original_func.__qualname__ != run_with_hypothesis.__qualname__:
 57s                     if iscoroutinefunction(original_func):
57s pyfuncitem.obj.hypothesis.inner_test = run_with_hypothesis
 57s      57s                 return None
 57s      57s             if iscoroutinefunction(pyfuncitem.obj):
 57s                 funcargs = pyfuncitem.funcargs
57s testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} 57s > with get_runner(backend_name, backend_options) as runner: 57s 57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:123: 57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s /usr/lib/python3.11/contextlib.py:137: in __enter__
 57s     return next(self.gen)
57s /usr/lib/python3/dist-packages/anyio/pytest_plugin.py:45: in get_runner
 57s     asynclib.create_test_runner(backend_options)
57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:2465: in create_test_runner
 57s     return TestRunner(**options)
57s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57s 57s self = <anyio._backends._asyncio.TestRunner object at 0xffff950c0a90>
 57s  57s     def __init__(
 57s         self,
 57s         *,
 57s         debug: bool | None = None,
 57s         use_uvloop: bool = False,
 57s         loop_factory: Callable[[], AbstractEventLoop] | None = None,
 57s     ) -> None:
 57s         if use_uvloop and loop_factory is None:
 57s >           import uvloop
 57s E           ModuleNotFoundError: No module named 'uvloop'
57s 57s /usr/lib/python3/dist-packages/anyio/_backends/_asyncio.py:1837: ModuleNotFoundError 57s =========================== short test summary info ============================ 57s FAILED tests/test_run_process.py::test_async_alive_terminates[asyncio+uvloop] 57s FAILED tests/test_watch.py::test_watch[asyncio+uvloop] - RuntimeError: Alread... 57s FAILED tests/test_watch.py::test_watch[asyncio] - RuntimeError: Already runni... 57s FAILED tests/test_watch.py::test_watch[trio] - RuntimeError: Already running ... 57s FAILED tests/test_watch.py::test_watch_watcher_kwargs[asyncio+uvloop] - Runti... 57s FAILED tests/test_watch.py::test_watch_watcher_kwargs[asyncio] - RuntimeError... 57s FAILED tests/test_watch.py::test_watch_watcher_kwargs[trio] - RuntimeError: A... 57s FAILED tests/test_watch.py::test_watch_stop[asyncio+uvloop] - RuntimeError: A... 57s FAILED tests/test_watch.py::test_watch_stop[asyncio] - RuntimeError: Already ... 57s FAILED tests/test_watch.py::test_watch_stop[trio] - RuntimeError: Already run... 57s FAILED tests/test_watch.py::test_watch_keyboard_error[asyncio+uvloop] - Runti... 57s FAILED tests/test_watch.py::test_watch_keyboard_error[asyncio] - RuntimeError... 57s FAILED tests/test_watch.py::test_watch_keyboard_error[trio] - RuntimeError: A... 57s FAILED tests/test_watch.py::test_watch_log[asyncio+uvloop] - RuntimeError: Al... 57s FAILED tests/test_watch.py::test_watch_log[asyncio] - RuntimeError: Already r... 57s FAILED tests/test_watch.py::test_watch_log[trio] - RuntimeError: Already runn... 57s FAILED tests/test_watch.py::test_awatch[asyncio+uvloop] - ModuleNotFoundError... 57s FAILED tests/test_watch.py::test_awatch_stop[asyncio+uvloop] - ModuleNotFound... 57s FAILED tests/test_watch.py::test_awatch_log[asyncio+uvloop] - ModuleNotFoundE... 57s ======================== 19 failed, 143 passed in 2.32s ======================== 57s E: pybuild pybuild:391: test: plugin distutils failed with: exit code=1: cd /tmp/autopkgtest-lxc.a1nj21mo/downtmp/autopkgtest_tmp/build; python3.11 -m pytest -W ignore::trio.TrioDeprecationWarning 57s pybuild-autopkgtest: error: pybuild --autopkgtest --test-pytest -i python{version} -p "3.12 3.11" returned exit code 13
 57s make: *** [/tmp/EHp9pSXxtv/run:4: pybuild-autopkgtest] Error 25
57s pybuild-autopkgtest: error: /tmp/EHp9pSXxtv/run pybuild-autopkgtest returned exit code 2
 57s autopkgtest [05:20:24]: test pybuild-autopkgtest

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to