Skip to content

Commit 231fa1e

Browse files
wip
1 parent f35ce32 commit 231fa1e

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ incremental in minor, bugfixes only are patches.
66
See [0Ver](https://0ver.org/).
77

88

9+
## 0.26.0
10+
11+
### Features
12+
13+
- Add `returns.methods.gather` utility method
14+
15+
916
## 0.25.0
1017

1118
### Features
@@ -33,7 +40,6 @@ See [0Ver](https://0ver.org/).
3340
- Add partition function to result module. Issue #1905
3441
- Add `default_error` parameter to `returns.converters.maybe_to_result`,
3542
which provides a default error value for `Failure`
36-
- Add `returns.methods.gather` utility method
3743

3844

3945
## 0.24.1

tests/test_methods/test_gather.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11

22
import pytest
33

4+
import anyio
45
from returns.future import Future, FutureResult
6+
from returns.result import Result
57
from returns.io import IO, IOResult
68
from returns.methods import gather
79

810

11+
async def _helper_func1() -> str:
12+
return 'successful function'
13+
14+
15+
async def _helper_func2() -> str:
16+
return 'failed function'
17+
918
@pytest.mark.parametrize(('containers', 'expected'), [
1019
(
1120
(
12-
Future.from_value(1),
13-
FutureResult.from_value(2),
21+
FutureResult.from_value(1),
1422
FutureResult.from_failure(None),
1523
),
16-
(IO(1), IOResult.from_value(2), IOResult.from_failure(None)),
24+
(IOResult.from_value(1), IOResult.from_failure(None)),
1725
),
1826
((), ()),
27+
(
28+
(
29+
_helper_func1(),
30+
_helper_func2(),
31+
),
32+
(IOResult.from_result(Result.from_value("successful function")), IOResult.from_result(Result.from_failure("failed function")))
33+
)
1934
])
20-
async def test_gather(containers, expected):
35+
def test_gather(containers, expected):
2136
"""Test partition function."""
22-
assert await gather(containers) == expected
37+
assert anyio.run(gather,containers) == expected

0 commit comments

Comments
 (0)