fix: websocket dependency for websockets 9.1 security fix (#2366)
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
from collections import deque, namedtuple
|
||||
|
||||
import pytest
|
||||
@@ -82,14 +79,6 @@ def test_listeners_triggered(app):
|
||||
with pytest.warns(UserWarning):
|
||||
server.run()
|
||||
|
||||
all_tasks = (
|
||||
asyncio.Task.all_tasks()
|
||||
if sys.version_info < (3, 7)
|
||||
else asyncio.all_tasks(asyncio.get_event_loop())
|
||||
)
|
||||
for task in all_tasks:
|
||||
task.cancel()
|
||||
|
||||
assert before_server_start
|
||||
assert after_server_start
|
||||
assert before_server_stop
|
||||
@@ -132,14 +121,6 @@ def test_listeners_triggered_async(app):
|
||||
with pytest.warns(UserWarning):
|
||||
server.run()
|
||||
|
||||
all_tasks = (
|
||||
asyncio.Task.all_tasks()
|
||||
if sys.version_info < (3, 7)
|
||||
else asyncio.all_tasks(asyncio.get_event_loop())
|
||||
)
|
||||
for task in all_tasks:
|
||||
task.cancel()
|
||||
|
||||
assert before_server_start
|
||||
assert after_server_start
|
||||
assert before_server_stop
|
||||
|
||||
@@ -13,7 +13,7 @@ from sanic.exceptions import PyFileError
|
||||
|
||||
@contextmanager
|
||||
def temp_path():
|
||||
""" a simple cross platform replacement for NamedTemporaryFile """
|
||||
"""a simple cross platform replacement for NamedTemporaryFile"""
|
||||
with TemporaryDirectory() as td:
|
||||
yield Path(td, "file")
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ def test_logging_pass_customer_logconfig():
|
||||
|
||||
@pytest.mark.parametrize("debug", (True, False))
|
||||
def test_log_connection_lost(app, debug, monkeypatch):
|
||||
""" Should not log Connection lost exception on non debug """
|
||||
"""Should not log Connection lost exception on non debug"""
|
||||
stream = StringIO()
|
||||
root = logging.getLogger("sanic.root")
|
||||
root.addHandler(logging.StreamHandler(stream))
|
||||
|
||||
@@ -289,18 +289,18 @@ def test_query_string(app):
|
||||
assert request.args.getlist("test1") == ["1"]
|
||||
assert request.args.get("test3", default="My value") == "My value"
|
||||
|
||||
|
||||
def test_popped_stays_popped(app):
|
||||
@app.route("/")
|
||||
async def handler(request):
|
||||
return text("OK")
|
||||
|
||||
request, response = app.test_client.get(
|
||||
"/", params=[("test1", "1")]
|
||||
)
|
||||
request, response = app.test_client.get("/", params=[("test1", "1")])
|
||||
|
||||
assert request.args.pop("test1") == ["1"]
|
||||
assert "test1" not in request.args
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_query_string_asgi(app):
|
||||
@app.route("/")
|
||||
|
||||
Reference in New Issue
Block a user