Skip to content

Commit f87b703

Browse files
authored
fix async test warning (#1251)
Hi, can you please consider patch to fix the following test warning. It ensures the async generator is properly closed by completing the `async for` loop. thanks ``` ========================================== warnings summary =========================================== tests/basilisp/compiler_test.py::TestFunctionDef::test_multi_arity_meta /opt/homebrew/Cellar/[email protected]/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py:744: RuntimeWarning: coroutine method 'aclose' of '__unique_kdghii_1104' was never awaited self._ready.clear() Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== 49 passed, 3718 deselected, 1 warning in 1.20s ============================ ``` Co-authored-by: ikappaki <[email protected]>
1 parent d35197a commit f87b703

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/basilisp/compiler_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3079,8 +3079,10 @@ def test_async_generator_single_statement(self, lcompile: CompileFn):
30793079
)
30803080

30813081
async def get():
3082+
ret = None
30823083
async for val in awaiter_fn():
3083-
return val
3084+
ret = val
3085+
return ret
30843086

30853087
assert kw.keyword("async-generator") == async_to_sync(get)
30863088

0 commit comments

Comments
 (0)