commit
a7dd73c657
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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()
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -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")
|
||||||
|
|
|
@ -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
|
||||||
|
|
6
tox.ini
6
tox.ini
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user