Skip to content

Test failures with trio >= 0.25.0Β #187

@mgorny

Description

@mgorny

After upgrading to trio >= 0.25.0, the exception-related tests start failing:

python -m pytest --cov=trio_websocket --no-cov-on-fail
============================= test session starts ==============================
platform linux -- Python 3.11.8, pytest-8.1.1, pluggy-1.4.0
rootdir: /tmp/trio-websocket
configfile: pytest.ini
plugins: trio-0.8.0, cov-5.0.0
collected 58 items

tests/test_connection.py .........................FFF...........FFF..... [ 81%]
.........F.                                                              [100%]

=================================== FAILURES ===================================
____________________ test_handshake_exception_before_accept ____________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 432, in test_handshake_exception_before_accept
    |     async with trio.open_nursery() as nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 432, in serve_websocket
      |     await server.run(task_status=task_status)
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1408, in run
      |     async with trio.open_nursery() as nursery:
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
      |     raise combined_error_from_nursery
      | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
      +-+---------------- 1 ----------------
        | Exception Group Traceback (most recent call last):
        |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_highlevel_serve_listeners.py", line 135, in serve_listeners
        |     async with trio.open_nursery() as nursery:
        |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
        |     raise combined_error_from_nursery
        | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
        +-+---------------- 1 ----------------
          | Exception Group Traceback (most recent call last):
          |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_highlevel_serve_listeners.py", line 33, in _run_handler
          |     await handler(stream)
          |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1426, in _handle_connection
          |     async with trio.open_nursery() as nursery:
          |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
          |     raise combined_error_from_nursery
          | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
          +-+---------------- 1 ----------------
            | Traceback (most recent call last):
            |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1439, in _handle_connection
            |     await self._handler(request)
            |   File "/tmp/trio-websocket/tests/test_connection.py", line 429, in handler
            |     raise ValueError()
            | ValueError
            +------------------------------------
____________________________ test_reject_handshake _____________________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 448, in test_reject_handshake
    |     async with open_websocket(HOST, server.port, RESOURCE, use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1225, in _reader_task
      |     await handler(event)
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1100, in _handle_reject_data_event
      |     raise ConnectionRejected(self._reject_status, self._reject_headers,
      | trio_websocket._impl.ConnectionRejected
      +------------------------------------
__________________ test_reject_handshake_invalid_info_status ___________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 470, in test_reject_handshake_invalid_info_status
    |     async with open_websocket(HOST, port, RESOURCE, use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1225, in _reader_task
      |     await handler(event)
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1089, in _handle_reject_connection_event
      |     raise ConnectionRejected(self._reject_status, self._reject_headers,
      | trio_websocket._impl.ConnectionRejected
      +------------------------------------
___________________________ test_client_open_timeout ___________________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 614, in test_client_open_timeout
    |     async with open_websocket(HOST, server.port, '/', use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 126, in open_websocket
      |     raise ConnectionTimeout from None
      | trio_websocket._impl.ConnectionTimeout
      +------------------------------------
__________________________ test_client_close_timeout ___________________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 642, in test_client_close_timeout
    |     async with open_websocket(HOST, server.port, RESOURCE, use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 217, in __aexit__
    |     await anext(self.gen)
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 136, in open_websocket
      |     raise DisconnectionTimeout from None
      | trio_websocket._impl.DisconnectionTimeout
      +------------------------------------
_____________________ test_client_connect_networking_error _____________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 652, in test_client_connect_networking_error
    |     async with open_websocket(HOST, 0, '/', use_ssl=False) as client_ws:
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 120, in open_websocket
      |     connection = await connect_websocket(new_nursery, host, port,
      |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/lib/python3.11/unittest/mock.py", line 2237, in _execute_mock_call
      |     raise effect
      | OSError
      | 
      | The above exception was the direct cause of the following exception:
      | 
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 128, in open_websocket
      |     raise HandshakeError from e
      | trio_websocket._impl.HandshakeError
      +------------------------------------
_____________________ test_finalization_dropped_exception ______________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 1014, in test_finalization_dropped_exception
    |     with trio.move_on_after(1):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 643, in __exit__
    |     raise remaining_error_after_cancel_scope
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 1015, in test_finalization_dropped_exception
    |     async with open_websocket(HOST, echo_server.port, RESOURCE, use_ssl=False):
    |   File "/usr/lib/python3.11/contextlib.py", line 231, in __aexit__
    |     await self.gen.athrow(typ, value, traceback)
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/tests/test_connection.py", line 1017, in test_finalization_dropped_exception
      |     await trio.sleep_forever()
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_timeouts.py", line 48, in sleep_forever
      |     await trio.lowlevel.wait_task_rescheduled(lambda _: trio.lowlevel.Abort.SUCCEEDED)
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_traps.py", line 179, in wait_task_rescheduled
      |     return (await _async_yield(WaitTaskRescheduled(abort_func))).unwrap()
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/outcome/_impl.py", line 213, in unwrap
      |     raise captured_error
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 1441, in raise_cancel
      |     raise Cancelled._create()
      | trio.Cancelled: Cancelled
      | 
      | During handling of the above exception, another exception occurred:
      | 
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 130, in open_websocket
      |     yield connection
      |   File "/tmp/trio-websocket/tests/test_connection.py", line 1019, in test_finalization_dropped_exception
      |     raise ValueError
      | ValueError
      +------------------------------------
=========================== short test summary info ============================
FAILED tests/test_connection.py::test_handshake_exception_before_accept - Exc...
FAILED tests/test_connection.py::test_reject_handshake - ExceptionGroup: Exce...
FAILED tests/test_connection.py::test_reject_handshake_invalid_info_status - ...
FAILED tests/test_connection.py::test_client_open_timeout - ExceptionGroup: E...
FAILED tests/test_connection.py::test_client_close_timeout - ExceptionGroup: ...
FAILED tests/test_connection.py::test_client_connect_networking_error - Excep...
FAILED tests/test_connection.py::test_finalization_dropped_exception - Except...
========================= 7 failed, 51 passed in 0.71s =========================
make: *** [Makefile:11: test] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions