Skip to content

Commit

Permalink
Version 23.3 compat (#65)
Browse files Browse the repository at this point in the history
* No failure on dupe exception handler

* Make pretty

* Bump version

* make pretty
  • Loading branch information
ahopkins committed Mar 26, 2023
1 parent 4b2aaaf commit 2f219db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sanic_testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sanic_testing.manager import TestManager

__version__ = "22.12.0"
__version__ = "23.3.0"
__all__ = ("TestManager",)
8 changes: 5 additions & 3 deletions sanic_testing/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import httpx
from sanic import Sanic # type: ignore
from sanic.asgi import ASGIApp # type: ignore
from sanic.exceptions import MethodNotSupported # type: ignore
from sanic.exceptions import MethodNotSupported, ServerError # type: ignore
from sanic.log import logger # type: ignore
from sanic.request import Request # type: ignore
from sanic.response import text # type: ignore
Expand Down Expand Up @@ -96,7 +96,6 @@ async def _local_request(self, method: str, url: str, *args, **kwargs):
return await websocket_proxy(url, *args, **kwargs)
else:
async with self.get_new_session(**session_kwargs) as session:

try:
if method == "request":
args = tuple([url] + list(args))
Expand Down Expand Up @@ -184,7 +183,10 @@ def _sanic_endpoint_test(
_collect_request
)

self.app.exception(MethodNotSupported)(self._error_handler)
try:
self.app.exception(MethodNotSupported)(self._error_handler)
except ServerError:
...

if self.port:
server_kwargs = dict(
Expand Down
1 change: 0 additions & 1 deletion tests/test_asgi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ async def test_basic_asgi_client(app, method):

@pytest.mark.asyncio
async def test_websocket_route(app):

ev = asyncio.Event()

@app.websocket("/ws")
Expand Down

0 comments on commit 2f219db

Please sign in to comment.