Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestMisc.test_run_task fails on python 3.11 #120

Closed
mweinelt opened this issue May 25, 2023 · 1 comment
Closed

TestMisc.test_run_task fails on python 3.11 #120

mweinelt opened this issue May 25, 2023 · 1 comment

Comments

@mweinelt
Copy link

Hi, we're seeing the following test fail on 0.12.0 with python 3.11.3. Is this project still maintained and will it be updated for python 3.11?

____________________________ TestMisc.test_run_task ____________________________

value = <trio.Nursery object at 0xfffff57e5fd0>

    async def yield_(value=None):
>       return await _yield_(value)

/nix/store/d6nw29xn6ca13k5d8hd85r0flch568yp-python3.11-async-generator-1.10/lib/python3.11/site-packages/async_generator/_impl.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/d6nw29xn6ca13k5d8hd85r0flch568yp-python3.11-async-generator-1.10/lib/python3.11/site-packages/async_generator/_impl.py:99: in _yield_
    return (yield _wrap(value))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.test_misc.TestMisc object at 0xfffff56cf790>

    @pytest.mark.trio
    async def test_run_task(self):
        owch = 0
    
        async def nest(x):
            nonlocal owch
            owch += x
    
        with pytest.raises(RuntimeError):
            trio_asyncio.run_trio_task(nest, 100)
    
        with pytest.raises((AttributeError, RuntimeError)):
>           with trio_asyncio.open_loop():
E           TypeError: '_AsyncGeneratorContextManager' object does not support the context manager protocol

tests/test_misc.py:105: TypeError
@oremanj
Copy link
Member

oremanj commented May 25, 2023

That test failure is because using a synchronous with statement on an async context manager changed from raising AttributeError to raising TypeError. It's not material to the functioning of the library.

trio-asyncio is not particularly maintained but as far as I know it still works fine in practice on recent Pythons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants