Merge pull request #23 from channelcat/master

py37 (#1256)
This commit is contained in:
7 2018-07-03 22:12:02 -07:00 committed by GitHub
commit a7dd73c657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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")

View File

@ -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

View File

@ -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