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

Support Trollius #9

Merged
merged 6 commits into from
Jul 21, 2014
Merged

Support Trollius #9

merged 6 commits into from
Jul 21, 2014

Conversation

vstinner
Copy link
Collaborator

  • Add GreenTrolliusTask, GreenTrolliusUnixSelectorLoop,
    GreenTrolliusEventLoopPolicy
  • Use backported TestCase of Trollius on Python 2 to get assertRaises()
  • Use exec() in test_tass.py because "yield from" raises a SyntaxError
    on Python 2
  • New test_trollius.py testing the interoperability of Trollis and
    asyncio coroutines. greenio should support executing asyncio
    coroutines in a trollius event loop.

@vstinner
Copy link
Collaborator Author

Updated pull request for Trollius.

@vstinner vstinner mentioned this pull request Jul 15, 2014
@1st1
Copy link
Owner

1st1 commented Jul 15, 2014

It seems that some unittests are failing, no?

* Add GreenTrolliusTask, GreenTrolliusUnixSelectorLoop,
  GreenTrolliusEventLoopPolicy
* Use backported TestCase of Trollius on Python 2 to get assertRaises()
* Use exec() in test_tass.py because "yield from" raises a SyntaxError
  on Python 2
* New test_trollius.py testing the interoperability of Trollis and
  asyncio coroutines. greenio should support executing asyncio
  coroutines in a trollius event loop.
@vstinner
Copy link
Collaborator Author

It seems that some unittests are failing, no?

Correct, test_task_yield_from_invalid() was still failing on Python 3 with tulip. It should now be fixed.

The exact error message depends on the version of Trollius and Tulip, if
they have the new create_task() function.

The check may be removed later when Trollius and Tulip with
create_task() will be widely deployed.
@vstinner
Copy link
Collaborator Author

The tests now pass, can you please merge my pull request Yury?

@1st1
Copy link
Owner

1st1 commented Jul 21, 2014

Hi Victor,

Can we avoid using exec? How about just having two separate test files, one for py2 and one for py3?

* Add a new test_asyncio_trollius.py file to test asyncio and trollius
  interoperability
* Move task tests for trollius into test_tasks_trollius.py
* Remove unused "import socket" in test_socket.py
@vstinner
Copy link
Collaborator Author

I reorganized tests to keep existing tests almost unchanged, but add new tests specific to Trollius.

I also added the new file test_asyncio_trollius.py which I forgot when I created this new pull request.

I tested the patch with:

  • python 2.7, trollius (dev)
  • python 3.3, tulip 3.4.1
  • python 3.3, tulip 3.4.1, trollius (dev)
  • python 3.3, tulip (dev), trollius (dev)

I found a bug in Trollius during these tests! I already fixed it in Trollius. When this pull request will be merged, I will release a new version of Trollius to get a release with create_task(). It will be the minimum version to use greenio with trollius.

@vstinner
Copy link
Collaborator Author

Sorry, I reverted "add loop parameter to task() and yield_from()". It was not (directly) related to the Trollius pull request. I will propose again the loop parameter later.

1st1 added a commit that referenced this pull request Jul 21, 2014
@1st1 1st1 merged commit 90e77b6 into 1st1:master Jul 21, 2014
@vstinner
Copy link
Collaborator Author

FYI I just release Trollius 1.0 which includes the new create_task() function. You need at least Trollius 1.0 to use greenio with Trollius.

Thanks for the merge!

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

Successfully merging this pull request may close these issues.

None yet

3 participants