py37 (#1256)
* 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:
parent
9092ee9f0e
commit
f9b29fd7e7
|
@ -13,6 +13,14 @@ matrix:
|
|||
python: 3.6
|
||||
- env: TOX_ENV=py36-no-ext
|
||||
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
|
||||
python: 3.6
|
||||
- env: TOX_ENV=check
|
||||
|
|
|
@ -2,4 +2,4 @@ aiofiles
|
|||
httptools
|
||||
ujson; 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
|
||||
|
|
|
@ -665,7 +665,7 @@ def serve(host, port, request_handler, error_handler, before_start=None,
|
|||
for conn in connections:
|
||||
if hasattr(conn, "websocket") and conn.websocket:
|
||||
coros.append(
|
||||
conn.websocket.close_connection(after_handshake=True)
|
||||
conn.websocket.close_connection()
|
||||
)
|
||||
else:
|
||||
conn.close()
|
||||
|
|
|
@ -116,7 +116,7 @@ class GunicornWorker(base.Worker):
|
|||
for conn in self.connections:
|
||||
if hasattr(conn, "websocket") and conn.websocket:
|
||||
coros.append(
|
||||
conn.websocket.close_connection(after_handshake=False)
|
||||
conn.websocket.close_connection()
|
||||
)
|
||||
else:
|
||||
conn.close()
|
||||
|
|
2
setup.py
2
setup.py
|
@ -60,7 +60,7 @@ requirements = [
|
|||
uvloop,
|
||||
ujson,
|
||||
'aiofiles>=0.3.0',
|
||||
'websockets>=4.0,<5.0',
|
||||
'websockets>=5.0,<6.0',
|
||||
]
|
||||
if strtobool(os.environ.get("SANIC_NO_UJSON", "no")):
|
||||
print("Installing without uJSON")
|
||||
|
|
|
@ -131,5 +131,5 @@ def test_worker_close(worker):
|
|||
loop.run_until_complete(_close)
|
||||
|
||||
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
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -1,11 +1,11 @@
|
|||
[tox]
|
||||
envlist = py35, py36, {py35,py36}-no-ext, flake8, check
|
||||
envlist = py35, py36, py37, {py35,py36,py37}-no-ext, flake8, check
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
setenv =
|
||||
{py35,py36}-no-ext: SANIC_NO_UJSON=1
|
||||
{py35,py36}-no-ext: SANIC_NO_UVLOOP=1
|
||||
{py35,py36,py37}-no-ext: SANIC_NO_UJSON=1
|
||||
{py35,py36,py37}-no-ext: SANIC_NO_UVLOOP=1
|
||||
deps =
|
||||
coverage
|
||||
pytest==3.3.2
|
||||
|
|
Loading…
Reference in New Issue
Block a user