Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* add py37 to travisci

* use dist:xenial for py37

* sudo: true in .travici

* bump websockets version for py37 support and fix unit tests
  • Loading branch information
yunstanford authored and r0fls committed Jul 4, 2018
1 parent 9092ee9 commit f9b29fd
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sanic/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion sanic/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def close(self):
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()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def open_local(paths, mode='r', encoding='utf8'):
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")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f9b29fd

Please sign in to comment.