fix unit test for windows ci
fix unit tests for windows ci add appveyor build status badge add readthedoc build status badge
This commit is contained in:
parent
8b5d137d8f
commit
e58ea8c7b4
|
@ -1,7 +1,7 @@
|
|||
Sanic
|
||||
=====
|
||||
|
||||
|Join the chat at https://gitter.im/sanic-python/Lobby| |Build Status| |Codecov| |PyPI| |PyPI version| |Code style black|
|
||||
|Join the chat at https://gitter.im/sanic-python/Lobby| |Build Status| |AppVeyor Build Status| |Documentation| |Codecov| |PyPI| |PyPI version| |Code style black|
|
||||
|
||||
Sanic is a Flask-like Python 3.5+ web server that's written to go fast. It's based on the work done by the amazing folks at magicstack, and was inspired by `this article <https://magic.io/blog/uvloop-blazing-fast-python-networking/>`_.
|
||||
|
||||
|
@ -51,6 +51,8 @@ Documentation
|
|||
:target: https://codecov.io/gh/huge-success/sanic
|
||||
.. |Build Status| image:: https://travis-ci.org/huge-success/sanic.svg?branch=master
|
||||
:target: https://travis-ci.org/huge-success/sanic
|
||||
.. |AppVeyor Build Status| image:: https://ci.appveyor.com/api/projects/status/d8pt3ids0ynexi8c/branch/master?svg=true
|
||||
:target: https://ci.appveyor.com/project/huge-success/sanic
|
||||
.. |Documentation| image:: https://readthedocs.org/projects/sanic/badge/?version=latest
|
||||
:target: http://sanic.readthedocs.io/en/latest/?badge=latest
|
||||
.. |PyPI| image:: https://img.shields.io/pypi/v/sanic.svg
|
||||
|
|
|
@ -31,6 +31,10 @@ def test_multiprocessing(app):
|
|||
assert len(process_list) == num_workers
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not hasattr(signal, 'SIGALRM'),
|
||||
reason='SIGALRM is not implemented for this platform',
|
||||
)
|
||||
def test_multiprocessing_with_blueprint(app):
|
||||
from sanic import Blueprint
|
||||
# Selects a number at random so we can spot check
|
||||
|
|
|
@ -173,7 +173,7 @@ class DelayableSanicTestClient(SanicTestClient):
|
|||
return response
|
||||
|
||||
|
||||
Config.REQUEST_TIMEOUT = 2
|
||||
Config.REQUEST_TIMEOUT = 0.6
|
||||
request_timeout_default_app = Sanic('test_request_timeout_default')
|
||||
request_no_timeout_app = Sanic('test_request_no_timeout')
|
||||
|
||||
|
@ -189,14 +189,14 @@ async def handler2(request):
|
|||
|
||||
|
||||
def test_default_server_error_request_timeout():
|
||||
client = DelayableSanicTestClient(request_timeout_default_app, None, 3)
|
||||
client = DelayableSanicTestClient(request_timeout_default_app, None, 2)
|
||||
request, response = client.get('/1')
|
||||
assert response.status == 408
|
||||
assert response.text == 'Error: Request Timeout'
|
||||
|
||||
|
||||
def test_default_server_error_request_dont_timeout():
|
||||
client = DelayableSanicTestClient(request_no_timeout_app, None, 1)
|
||||
client = DelayableSanicTestClient(request_no_timeout_app, None, 0.2)
|
||||
request, response = client.get('/1')
|
||||
assert response.status == 200
|
||||
assert response.text == 'OK'
|
||||
|
|
Loading…
Reference in New Issue
Block a user