achimnol / aiotools

Idiomatic asyncio utilties
https://aiotools.readthedocs.io
MIT License
153 stars 11 forks source link

Supports uvloop event loop policy and divides test environment with tox #7

Closed Suckzoo closed 6 months ago

Suckzoo commented 7 years ago

To configure event loop easily, I fixed tests/conftest.py to accept command line argument --loop-policy. Event loop policy is changed in pytest_collection_modifyitems and it works. But I'm not sure whether it is an anti-pattern or not.

Also, I wrote tox.ini to divide test environment by event loop policy. In this pull request, it supports uvloop. It is easy to extend with another 3rd party event loop policy: just adding environment and dependency and it's done.

However, it seems that tox does not handle UNIX signal properly. Currently sequential test does not work. We can temporarily add pytest command to .travis.yml, but I think it is not a good idea.

Feedbacks are always welcomed, thanks.

codecov[bot] commented 7 years ago

Codecov Report

Merging #7 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #7   +/-   ##
=======================================
  Coverage   96.08%   96.08%           
=======================================
  Files           4        4           
  Lines         230      230           
=======================================
  Hits          221      221           
  Misses          9        9

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f018c84...4e7ef5c. Read the comment docs.

Suckzoo commented 7 years ago

@achimnol Fixed.

Suckzoo commented 7 years ago

@achimnol Applied your feedback. Please review the latest commit. Thanks.

Suckzoo commented 7 years ago

For now, tox is not applicable as tox is killed by signals in timer tests.

achimnol commented 7 years ago

Let's postpone adoption of tokio as it currently requries the nightly version of Rust and its installation process needs some touches.