Skip to content

Commit 0929871

Browse files
authored
Pin Sanic version for CI (#1650)
* Make it work on macos * Exclude new version of Sanic from tests because it has breaking changes.
1 parent 77b583a commit 0929871

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

scripts/runtox.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ elif [ -n "$AZURE_PYTHON_VERSION" ]; then
2727
fi
2828

2929
export TOX_PARALLEL_NO_SPINNER=1
30-
exec $TOXPATH --parallel auto -e $($TOXPATH -l | grep "$searchstring" | tr $'\n' ',') -- "${@:2}"
30+
exec $TOXPATH -p auto -e $($TOXPATH -l | grep "$searchstring" | tr $'\n' ',') -- "${@:2}"

tests/integrations/sanic/test_sanic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def new_test_client(self):
3232

3333
Sanic.test_client = property(new_test_client)
3434

35-
if SANIC_VERSION >= (20, 12):
36-
# Build (20.12.0) adds a feature where the instance is stored in an internal class
35+
if SANIC_VERSION >= (20, 12) and SANIC_VERSION < (22, 6):
36+
# Some builds (20.12.0 intruduced and 22.6.0 removed again) have a feature where the instance is stored in an internal class
3737
# registry for later retrieval, and so add register=False to disable that
3838
app = Sanic("Test", register=False)
3939
else:
@@ -229,7 +229,6 @@ def __init__(self, request_body):
229229
def respond(self, response):
230230
responses.append(response)
231231
patched_response = HTTPResponse()
232-
patched_response.send = lambda end_stream: asyncio.sleep(0.001)
233232
return patched_response
234233

235234
def __aiter__(self):

tox.ini

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ envlist =
5151
{py3.6,py3.7}-sanic-19
5252
{py3.6,py3.7,py3.8}-sanic-20
5353
{py3.7,py3.8,py3.9,py3.10}-sanic-21
54+
{py3.7,py3.8,py3.9,py3.10}-sanic-22
5455

5556
{py2.7}-celery-3
5657
{py2.7,py3.5,py3.6}-celery-{4.1,4.2}
@@ -160,9 +161,12 @@ deps =
160161
sanic-19: sanic>=19.0,<20.0
161162
sanic-20: sanic>=20.0,<21.0
162163
sanic-21: sanic>=21.0,<22.0
163-
{py3.7,py3.8,py3.9,py3.10}-sanic-21: sanic_testing
164-
{py3.5,py3.6}-sanic: aiocontextvars==0.2.1
164+
sanic-22: sanic>=22.0,<22.9.0
165+
165166
sanic: aiohttp
167+
sanic-21: sanic_testing<22
168+
sanic-22: sanic_testing<22.9.0
169+
{py3.5,py3.6}-sanic: aiocontextvars==0.2.1
166170
py3.5-sanic: ujson<4
167171

168172
beam-2.12: apache-beam>=2.12.0, <2.13.0

0 commit comments

Comments
 (0)