squash
This commit is contained in:
parent
5377a6eee3
commit
55a5ab4be1
4
Makefile
4
Makefile
|
@ -63,7 +63,7 @@ ifdef include_tests
|
|||
isort -rc sanic tests
|
||||
else
|
||||
$(info Sorting Imports)
|
||||
isort -rc sanic tests
|
||||
isort -rc sanic tests --profile=black
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -71,7 +71,7 @@ black:
|
|||
black --config ./.black.toml sanic tests
|
||||
|
||||
fix-import: black
|
||||
isort sanic tests
|
||||
isort sanic tests --profile=black
|
||||
|
||||
|
||||
docs-clean:
|
||||
|
|
|
@ -14,8 +14,8 @@ from traceback import format_exc
|
|||
from typing import Any, Dict, Iterable, List, Optional, Set, Type, Union
|
||||
from urllib.parse import urlencode, urlunparse
|
||||
|
||||
from sanic_routing.exceptions import FinalizationError
|
||||
from sanic_routing.route import Route
|
||||
from sanic_routing.exceptions import FinalizationError # type: ignore
|
||||
from sanic_routing.route import Route # type: ignore
|
||||
|
||||
from sanic import reloader_helpers
|
||||
from sanic.asgi import ASGIApp
|
||||
|
|
|
@ -2,7 +2,7 @@ from inspect import signature
|
|||
from pathlib import PurePath
|
||||
from typing import Set, Union
|
||||
|
||||
from sanic_routing.route import Route
|
||||
from sanic_routing.route import Route # type: ignore
|
||||
|
||||
from sanic.constants import HTTP_METHODS
|
||||
from sanic.models.futures import FutureRoute, FutureStatic
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
from functools import lru_cache
|
||||
from typing import Iterable, List, Optional, Union
|
||||
|
||||
from sanic_routing import BaseRouter
|
||||
from sanic_routing.exceptions import NoMethod
|
||||
from sanic_routing.exceptions import NotFound as RoutingNotFound
|
||||
from sanic_routing.route import Route
|
||||
from sanic_routing import BaseRouter # type: ignore
|
||||
from sanic_routing.exceptions import NoMethod # type: ignore
|
||||
from sanic_routing.exceptions import (
|
||||
NotFound as RoutingNotFound, # type: ignore
|
||||
)
|
||||
from sanic_routing.route import Route # type: ignore
|
||||
|
||||
from sanic.constants import HTTP_METHODS
|
||||
from sanic.exceptions import MethodNotSupported, NotFound
|
||||
|
|
|
@ -7,11 +7,9 @@ from json import loads as json_loads
|
|||
from urllib.parse import urlparse
|
||||
|
||||
import pytest
|
||||
import ujson
|
||||
|
||||
from sanic_testing.testing import (
|
||||
ASGI_BASE_URL,
|
||||
ASGI_HOST,
|
||||
ASGI_PORT,
|
||||
HOST,
|
||||
PORT,
|
||||
|
|
|
@ -161,9 +161,10 @@ def test_matching(path, headers, expected):
|
|||
request = Request(path, headers, None, "GET", None, app)
|
||||
|
||||
try:
|
||||
app.router.get(request=request)
|
||||
except NotFound:
|
||||
response = 404
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
response = 500
|
||||
else:
|
||||
response = 200
|
||||
|
|
Loading…
Reference in New Issue
Block a user