File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22
3+ from typing import NoReturn
4+
35import pytest
46import pytest_trio .plugin # type: ignore # noqa
57import trio
@@ -64,7 +66,7 @@ async def test_trio_error() -> None:
6466 """
6567
6668 async with TrioEventEmitter () as ee :
67- send , rcv = trio .open_memory_channel (1 )
69+ send , rcv = trio .open_memory_channel [ PyeeTestError ] (1 )
6870
6971 @ee .on ("event" )
7072 async def event_handler ():
@@ -90,14 +92,14 @@ async def test_sync_error() -> None:
9092 """Test that regular functions have the same error handling as coroutines"""
9193
9294 async with TrioEventEmitter () as ee :
93- send , rcv = trio .open_memory_channel (1 )
95+ send , rcv = trio .open_memory_channel [ PyeeTestError ] (1 )
9496
9597 @ee .on ("event" )
96- def sync_handler ():
98+ def sync_handler () -> NoReturn :
9799 raise PyeeTestError ()
98100
99101 @ee .on ("error" )
100- async def handle_error (exc ):
102+ async def handle_error (exc ) -> None :
101103 async with send :
102104 await send .send (exc )
103105
You can’t perform that action at this time.
0 commit comments