* add py37 to travisci

* use dist:xenial for py37

* sudo: true in .travici

* bump websockets version for py37 support and fix unit tests
This commit is contained in:
7 2018-07-03 22:07:08 -07:00 committed by Raphael Deem
parent 9092ee9f0e
commit f9b29fd7e7
7 changed files with 16 additions and 8 deletions

View File

@ -13,6 +13,14 @@ matrix:
python: 3.6 python: 3.6
- env: TOX_ENV=py36-no-ext - env: TOX_ENV=py36-no-ext
python: 3.6 python: 3.6
- env: TOX_ENV=py37
python: 3.7
dist: xenial
sudo: true
- env: TOX_ENV=py37-no-ext
python: 3.7
dist: xenial
sudo: true
- env: TOX_ENV=flake8 - env: TOX_ENV=flake8
python: 3.6 python: 3.6
- env: TOX_ENV=check - env: TOX_ENV=check

View File

@ -2,4 +2,4 @@ aiofiles
httptools httptools
ujson; sys_platform != "win32" and implementation_name == "cpython" ujson; sys_platform != "win32" and implementation_name == "cpython"
uvloop; sys_platform != "win32" and implementation_name == "cpython" uvloop; sys_platform != "win32" and implementation_name == "cpython"
websockets>=4.0,<5.0 websockets>=5.0,<6.0

View File

@ -665,7 +665,7 @@ def serve(host, port, request_handler, error_handler, before_start=None,
for conn in connections: for conn in connections:
if hasattr(conn, "websocket") and conn.websocket: if hasattr(conn, "websocket") and conn.websocket:
coros.append( coros.append(
conn.websocket.close_connection(after_handshake=True) conn.websocket.close_connection()
) )
else: else:
conn.close() conn.close()

View File

@ -116,7 +116,7 @@ class GunicornWorker(base.Worker):
for conn in self.connections: for conn in self.connections:
if hasattr(conn, "websocket") and conn.websocket: if hasattr(conn, "websocket") and conn.websocket:
coros.append( coros.append(
conn.websocket.close_connection(after_handshake=False) conn.websocket.close_connection()
) )
else: else:
conn.close() conn.close()

View File

@ -60,7 +60,7 @@ requirements = [
uvloop, uvloop,
ujson, ujson,
'aiofiles>=0.3.0', 'aiofiles>=0.3.0',
'websockets>=4.0,<5.0', 'websockets>=5.0,<6.0',
] ]
if strtobool(os.environ.get("SANIC_NO_UJSON", "no")): if strtobool(os.environ.get("SANIC_NO_UJSON", "no")):
print("Installing without uJSON") print("Installing without uJSON")

View File

@ -131,5 +131,5 @@ def test_worker_close(worker):
loop.run_until_complete(_close) loop.run_until_complete(_close)
assert worker.signal.stopped == True assert worker.signal.stopped == True
conn.websocket.close_connection.assert_called_with(after_handshake=False) assert conn.websocket.close_connection.called == True
assert len(worker.servers) == 0 assert len(worker.servers) == 0

View File

@ -1,11 +1,11 @@
[tox] [tox]
envlist = py35, py36, {py35,py36}-no-ext, flake8, check envlist = py35, py36, py37, {py35,py36,py37}-no-ext, flake8, check
[testenv] [testenv]
usedevelop = True usedevelop = True
setenv = setenv =
{py35,py36}-no-ext: SANIC_NO_UJSON=1 {py35,py36,py37}-no-ext: SANIC_NO_UJSON=1
{py35,py36}-no-ext: SANIC_NO_UVLOOP=1 {py35,py36,py37}-no-ext: SANIC_NO_UVLOOP=1
deps = deps =
coverage coverage
pytest==3.3.2 pytest==3.3.2