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

Python 3.7.0 test failures #56

Closed
bowlofeggs opened this issue Jul 30, 2018 · 13 comments
Closed

Python 3.7.0 test failures #56

bowlofeggs opened this issue Jul 30, 2018 · 13 comments

Comments

@bowlofeggs
Copy link

Greetings!

I've been working on getting python-backoff to work in Fedora's Rawhide release, which recently upgraded to the recently released Python 3.7. There are three test failures there:

_________________________________________ test_on_exception_coro_cancelling __________________________________________
                                                      
event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>                                          
                                     
    @pytest.mark.asyncio                                                                                                                                                                                                                     
    def test_on_exception_coro_cancelling(event_loop):      
        sleep_started_event = asyncio.Event()
    
        @backoff.on_predicate(backoff.expo)
        @asyncio.coroutine                               
        def coro():
            sleep_started_event.set()
                
            try:
                yield from asyncio.sleep(10)                                    
            except asyncio.CancelledError:
                return True
    
            return False
    
        task = event_loop.create_task(coro())
    
>       yield from sleep_started_event.wait()
E       TypeError: cannot 'yield from' a coroutine object in a non-coroutine generator

tests/python34/test_backoff_async.py:568: TypeError
_______________________________________ test_on_exception_on_regular_function ________________________________________

    @pytest.mark.asyncio
    def test_on_exception_on_regular_function():
        # Force this function to be a running coroutine.
>       yield from asyncio.sleep(0)
E       TypeError: cannot 'yield from' a coroutine object in a non-coroutine generator

tests/python34/test_backoff_async.py:578: TypeError
_______________________________________ test_on_predicate_on_regular_function ________________________________________

    @pytest.mark.asyncio
    def test_on_predicate_on_regular_function():
        # Force this function to be a running coroutine.
>       yield from asyncio.sleep(0)
E       TypeError: cannot 'yield from' a coroutine object in a non-coroutine generator

tests/python34/test_backoff_async.py:590: TypeError
@bowlofeggs
Copy link
Author

This sounds possibly related, though the comments mention that the "yield from" syntax should still work:

https://bugs.python.org/issue32193

@hroncok
Copy link

hroncok commented Jul 30, 2018

You need #55 or hroncok@274e47d

@bowlofeggs
Copy link
Author

Oh thanks @hroncok! Maybe you could make your commit message reference this issue.

hroncok added a commit to hroncok/backoff that referenced this issue Jul 30, 2018
Fixes litl#56

Most likely breaks Python 3.4
@hroncok
Copy link

hroncok commented Jul 30, 2018

hroncok@5db3029

@bowlofeggs
Copy link
Author

I can confirm that #55 solves my build issue.

@hroncok I see that you made a similar but smaller patch - do you recommend I use that in Fedora instead?

@hroncok
Copy link

hroncok commented Jul 30, 2018

Well #55 solves more problems, maybe use that one instead.

@bowlofeggs
Copy link
Author

@hroncok Cool, I will import it into Fedora for now and wait to see what @litl goes with for the long term. Thanks for pointing me in the right direction!

@bgreen-litl
Copy link
Member

I'm not sure the right way to handle this yet and It's going to take some time for me to get my head around it. I definitely want to get backoff and tests running cleanly on 3.7 though. Unfortunately I'm not going to have time to dig into this for a couple weeks. In the short term, for you guys, dropping 3.4 support seems reasonable to me.

@bowlofeggs
Copy link
Author

Yeah I'm happy to use that cited patch for now in Fedora Rawhide until there's an official merged commit that works with Python 3.7.

@bgreen-litl
Copy link
Member

Here is a PR which explicitly supports python 3.7 and drops async support in python 3.4 in the process. #59

@bgreen-litl
Copy link
Member

#59 is now merged. I'm planning to release this as part of backoff 2.0 and python 3.7 will work out of the box there.

@bgreen-litl
Copy link
Member

@bowlofeggs I ended up releasing this as backoff 1.7.0 - should work out of the box for python 3.7 now

@bowlofeggs
Copy link
Author

Thanks!

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

3 participants