This commit is contained in:
Adam Hopkins 2021-02-15 14:01:32 +02:00
parent 5377a6eee3
commit 55a5ab4be1
7 changed files with 14 additions and 13 deletions

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -35,7 +35,7 @@ deps =
commands =
flake8 sanic
black --config ./.black.toml --check --verbose sanic/
isort --check-only sanic
isort --check-only sanic --profile=black
[testenv:type-checking]
deps =