Skip to content

Commit 5bab4bc

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
1 parent f35ce32 commit 5bab4bc

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

returns/methods/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Set of various utility functions."""
2+
23
from returns.methods.async_ import gather as gather
34
from returns.methods.cond import cond as cond
45
from returns.methods.partition import partition as partition

returns/methods/async_.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# flake8: noqa: WPS102
22

3-
from typing import Awaitable, Iterable
3+
from collections.abc import Awaitable, Iterable
44

55
import anyio
66

77
from returns.io import IOResult
88

99

1010
async def gather(
11-
containers: Iterable[
12-
Awaitable,
13-
],
11+
containers: Iterable[Awaitable,],
1412
) -> tuple[IOResult, ...]:
1513
"""
1614
Execute multiple coroutines concurrently and return their wrapped results.

tests/test_methods/test_gather.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
21
import pytest
32

43
from returns.future import Future, FutureResult
54
from returns.io import IO, IOResult
65
from returns.methods import gather
76

87

9-
@pytest.mark.parametrize(('containers', 'expected'), [
10-
(
8+
@pytest.mark.parametrize(
9+
('containers', 'expected'),
10+
[
1111
(
12-
Future.from_value(1),
13-
FutureResult.from_value(2),
14-
FutureResult.from_failure(None),
12+
(
13+
Future.from_value(1),
14+
FutureResult.from_value(2),
15+
FutureResult.from_failure(None),
16+
),
17+
(IO(1), IOResult.from_value(2), IOResult.from_failure(None)),
1518
),
16-
(IO(1), IOResult.from_value(2), IOResult.from_failure(None)),
17-
),
18-
((), ()),
19-
])
19+
((), ()),
20+
],
21+
)
2022
async def test_gather(containers, expected):
2123
"""Test partition function."""
2224
assert await gather(containers) == expected

0 commit comments

Comments
 (0)