Skip to content

Commit 300644c

Browse files
committed
split up tests
1 parent 66b70c0 commit 300644c

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

stdlib/@tests/test_cases/asyncio/check_coroutines.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from __future__ import annotations
22

3-
import inspect
43
import sys
54
from asyncio import iscoroutinefunction
65
from collections.abc import Awaitable, Callable, Coroutine
7-
from types import CoroutineType
86
from typing import Any
97
from typing_extensions import assert_type
108

@@ -40,22 +38,3 @@ def test_iscoroutinefunction_asyncio(
4038

4139
if iscoroutinefunction(xx):
4240
assert_type(xx, Callable[..., Coroutine[Any, Any, Any]])
43-
44-
45-
def test_iscoroutinefunction_inspect(
46-
x: Callable[[str, int], Coroutine[str, int, bytes]],
47-
y: Callable[[str, int], Awaitable[bytes]],
48-
z: Callable[[str, int], str | Awaitable[bytes]],
49-
xx: object,
50-
) -> None:
51-
if inspect.iscoroutinefunction(x):
52-
assert_type(x, Callable[[str, int], Coroutine[str, int, bytes]])
53-
54-
if inspect.iscoroutinefunction(y):
55-
assert_type(y, Callable[[str, int], CoroutineType[Any, Any, bytes]])
56-
57-
if inspect.iscoroutinefunction(z):
58-
assert_type(z, Callable[[str, int], CoroutineType[Any, Any, Any]])
59-
60-
if inspect.iscoroutinefunction(xx):
61-
assert_type(xx, Callable[..., CoroutineType[Any, Any, Any]])
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from __future__ import annotations
2+
3+
import inspect
4+
from collections.abc import Awaitable, Callable, Coroutine
5+
from types import CoroutineType
6+
from typing import Any
7+
from typing_extensions import assert_type
8+
9+
10+
def test_iscoroutinefunction_inspect(
11+
x: Callable[[str, int], Coroutine[str, int, bytes]],
12+
y: Callable[[str, int], Awaitable[bytes]],
13+
z: Callable[[str, int], str | Awaitable[bytes]],
14+
xx: object,
15+
) -> None:
16+
if inspect.iscoroutinefunction(x):
17+
assert_type(x, Callable[[str, int], Coroutine[str, int, bytes]])
18+
19+
if inspect.iscoroutinefunction(y):
20+
assert_type(y, Callable[[str, int], CoroutineType[Any, Any, bytes]])
21+
22+
if inspect.iscoroutinefunction(z):
23+
assert_type(z, Callable[[str, int], CoroutineType[Any, Any, Any]])
24+
25+
if inspect.iscoroutinefunction(xx):
26+
assert_type(xx, Callable[..., CoroutineType[Any, Any, Any]])

0 commit comments

Comments
 (0)