Skip to content

Commit 8d16ea2

Browse files
committed
Type check trio tests
1 parent 022d425 commit 8d16ea2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_trio.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
from typing import NoReturn
4+
35
import pytest
46
import pytest_trio.plugin # type: ignore # noqa
57
import 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

0 commit comments

Comments
 (0)