Removed flake8, black and isort; moving towards ruff default settings instead.
This commit is contained in:
@@ -3,10 +3,8 @@ from random import choice, seed
|
||||
from pytest import mark
|
||||
|
||||
import sanic.router
|
||||
|
||||
from sanic.request import Request
|
||||
|
||||
|
||||
seed("Pack my box with five dozen liquor jugs.")
|
||||
|
||||
# Disable Caching for testing purpose
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import asyncio
|
||||
|
||||
from textwrap import dedent
|
||||
from typing import AnyStr
|
||||
|
||||
|
||||
@@ -7,14 +7,12 @@ import re
|
||||
import string
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
from contextlib import suppress
|
||||
from logging import LogRecord
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import RouteExists
|
||||
from sanic_testing.testing import PORT
|
||||
|
||||
@@ -23,7 +21,6 @@ from sanic.constants import HTTP_METHODS
|
||||
from sanic.router import Router
|
||||
from sanic.touchup.service import TouchUp
|
||||
|
||||
|
||||
slugify = re.compile(r"[^a-zA-Z0-9_\-]")
|
||||
random.seed("Pack my box with five dozen liquor jugs.")
|
||||
Sanic.test_mode = True
|
||||
|
||||
@@ -5,7 +5,6 @@ from sanic.application.constants import Mode
|
||||
from sanic.config import Config
|
||||
from sanic.log import LOGGING_CONFIG_DEFAULTS, logger
|
||||
|
||||
|
||||
LOGGING_CONFIG = {**LOGGING_CONFIG_DEFAULTS}
|
||||
LOGGING_CONFIG["formatters"]["generic"]["format"] = "%(message)s"
|
||||
LOGGING_CONFIG["loggers"]["sanic.root"]["level"] = "DEBUG"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from aioquic.h3.connection import H3Connection
|
||||
from aioquic.h3.events import DataReceived, HeadersReceived
|
||||
from aioquic.quic.configuration import QuicConfiguration
|
||||
@@ -18,7 +17,6 @@ from sanic.models.server_types import ConnInfo
|
||||
from sanic.response import empty, json
|
||||
from sanic.server.protocols.http_protocol import Http3Protocol
|
||||
|
||||
|
||||
try:
|
||||
from unittest.mock import AsyncMock
|
||||
except ImportError:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from asyncio import Event
|
||||
from pathlib import Path
|
||||
|
||||
@@ -10,7 +9,6 @@ from sanic import Sanic
|
||||
from sanic.compat import UVLOOP_INSTALLED
|
||||
from sanic.http.constants import HTTP
|
||||
|
||||
|
||||
parent_dir = Path(__file__).parent.parent
|
||||
localhost_dir = parent_dir / "certs/localhost"
|
||||
|
||||
|
||||
@@ -5,10 +5,8 @@ import sys
|
||||
|
||||
import ujson as json
|
||||
import uvloop
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
|
||||
loop = uvloop.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Run with: gunicorn --workers=1 --worker-class=meinheld.gmeinheld.MeinheldWorker -b :8000 simple_server:app
|
||||
import bottle
|
||||
import ujson
|
||||
|
||||
from bottle import route
|
||||
|
||||
|
||||
|
||||
@@ -4,10 +4,8 @@ import logging
|
||||
|
||||
import ujson
|
||||
import uvloop
|
||||
|
||||
from kyoukai import HTTPRequestContext, Kyoukai
|
||||
|
||||
|
||||
loop = uvloop.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import timeit
|
||||
|
||||
from sanic.response import json
|
||||
|
||||
|
||||
currentdir = os.path.dirname(
|
||||
os.path.abspath(inspect.getfile(inspect.currentframe()))
|
||||
)
|
||||
|
||||
@@ -5,7 +5,6 @@ import sys
|
||||
from sanic import Sanic
|
||||
from sanic.response import json
|
||||
|
||||
|
||||
currentdir = os.path.dirname(
|
||||
os.path.abspath(inspect.getfile(inspect.currentframe()))
|
||||
)
|
||||
|
||||
@@ -6,7 +6,6 @@ from sanic import Sanic
|
||||
from sanic.exceptions import ServerError
|
||||
from sanic.response import json, text
|
||||
|
||||
|
||||
currentdir = os.path.dirname(
|
||||
os.path.abspath(inspect.getfile(inspect.currentframe()))
|
||||
)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Run with: python simple_server.py
|
||||
import ujson
|
||||
|
||||
from tornado import ioloop, web
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
""" Minimal helloworld application.
|
||||
"""
|
||||
import ujson
|
||||
|
||||
from wheezy.http import HTTPResponse, WSGIApplication
|
||||
from wheezy.routing import url
|
||||
from wheezy.web.handlers import BaseHandler
|
||||
@@ -37,7 +36,6 @@ main = WSGIApplication(
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
from wsgiref.simple_server import make_server
|
||||
|
||||
try:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import re
|
||||
|
||||
from collections import Counter
|
||||
from inspect import isawaitable
|
||||
from os import environ
|
||||
@@ -10,7 +9,6 @@ from unittest.mock import Mock, patch
|
||||
import pytest
|
||||
|
||||
import sanic
|
||||
|
||||
from sanic import Sanic
|
||||
from sanic.compat import OS_IS_WINDOWS
|
||||
from sanic.config import Config
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import logging
|
||||
|
||||
from collections import deque, namedtuple
|
||||
from unittest.mock import call
|
||||
|
||||
import pytest
|
||||
import uvicorn
|
||||
|
||||
from httpx import Headers
|
||||
from pytest import MonkeyPatch
|
||||
|
||||
@@ -18,7 +16,6 @@ from sanic.response import json, text
|
||||
from sanic.server.websockets.connection import WebSocketConnection
|
||||
from sanic.signals import RESERVED_NAMESPACES
|
||||
|
||||
|
||||
try:
|
||||
from unittest.mock import AsyncMock
|
||||
except ImportError:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import RouteExists
|
||||
|
||||
from sanic import Blueprint, Request, Sanic
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from pytest import raises
|
||||
|
||||
from sanic.app import Sanic
|
||||
@@ -9,7 +8,6 @@ from sanic.exceptions import BadRequest, Forbidden, SanicException, ServerError
|
||||
from sanic.request import Request
|
||||
from sanic.response import HTTPResponse, text
|
||||
|
||||
|
||||
MIDDLEWARE_INVOKE_COUNTER = {"request": 0, "response": 0}
|
||||
|
||||
AUTH = "dGVzdDp0ZXN0Cg=="
|
||||
|
||||
@@ -11,7 +11,6 @@ from sanic.exceptions import BadRequest, NotFound, SanicException, ServerError
|
||||
from sanic.request import Request
|
||||
from sanic.response import json, text
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
# GET
|
||||
# ------------------------------------------------------------ #
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
from pathlib import Path
|
||||
from typing import List, Optional, Tuple
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_routing import __version__ as __routing_version__
|
||||
|
||||
from sanic import __version__
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import logging
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from contextlib import contextmanager
|
||||
from os import environ
|
||||
from pathlib import Path
|
||||
@@ -9,7 +8,6 @@ from textwrap import dedent
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
import pytest
|
||||
|
||||
from pytest import MonkeyPatch
|
||||
|
||||
from sanic import Sanic
|
||||
|
||||
@@ -12,7 +12,6 @@ from sanic.exceptions import ServerError
|
||||
from sanic.response import text
|
||||
from sanic.response.convenience import json
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
# GET
|
||||
# ------------------------------------------------------------ #
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
from threading import Event
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import RouteExists
|
||||
|
||||
from sanic.response import text
|
||||
|
||||
@@ -3,7 +3,6 @@ import logging
|
||||
import pytest
|
||||
|
||||
import sanic
|
||||
|
||||
from sanic import Sanic
|
||||
from sanic.config import Config
|
||||
from sanic.errorpages import TextRenderer, exception_response, guess_mime
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from sanic import Sanic
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from typing import Callable, List
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from pytest import LogCaptureFixture, MonkeyPatch
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import pytest
|
||||
|
||||
from sanic import Sanic
|
||||
|
||||
|
||||
try:
|
||||
import sanic_ext # noqa: F401
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ from pytest import LogCaptureFixture
|
||||
|
||||
from sanic.response import empty
|
||||
|
||||
|
||||
PORT = 42101
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import json as stdjson
|
||||
|
||||
from collections import namedtuple
|
||||
from pathlib import Path
|
||||
from sys import version_info
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.reusable import ReusableClient
|
||||
|
||||
from sanic import json, text
|
||||
from sanic.app import Sanic
|
||||
from tests.client import RawClient
|
||||
|
||||
|
||||
parent_dir = Path(__file__).parent
|
||||
localhost_dir = parent_dir / "certs/localhost"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import sys
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -8,7 +7,6 @@ from sanic.app import Sanic
|
||||
from sanic.response import empty
|
||||
from tests.client import RawClient
|
||||
|
||||
|
||||
parent_dir = Path(__file__).parent
|
||||
localhost_dir = parent_dir / "certs/localhost"
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ from json import loads as sloads
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
try:
|
||||
from ujson import loads as uloads
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import sys
|
||||
|
||||
from dataclasses import asdict, dataclass
|
||||
from functools import partial
|
||||
from json import dumps as sdumps
|
||||
@@ -8,10 +7,8 @@ from typing import Dict
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
try:
|
||||
import ujson
|
||||
|
||||
from ujson import dumps as udumps
|
||||
|
||||
ujson_version = tuple(
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
import asyncio
|
||||
import platform
|
||||
|
||||
from asyncio import sleep as aio_sleep
|
||||
from itertools import count
|
||||
from os import environ
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.reusable import ReusableClient
|
||||
|
||||
from sanic import Sanic
|
||||
from sanic.compat import OS_IS_WINDOWS
|
||||
from sanic.response import text
|
||||
|
||||
|
||||
CONFIG_FOR_TESTS = {"KEEP_ALIVE_TIMEOUT": 2, "KEEP_ALIVE": True}
|
||||
|
||||
PORT = 42001 # test_keep_alive_timeout_reuse doesn't work with random port
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
from importlib import reload
|
||||
from io import StringIO
|
||||
from unittest.mock import Mock
|
||||
@@ -8,12 +7,10 @@ from unittest.mock import Mock
|
||||
import pytest
|
||||
|
||||
import sanic
|
||||
|
||||
from sanic import Sanic
|
||||
from sanic.log import LOGGING_CONFIG_DEFAULTS, Colors, logger
|
||||
from sanic.response import text
|
||||
|
||||
|
||||
logging_format = """module: %(module)s; \
|
||||
function: %(funcName)s(); \
|
||||
message: %(message)s"""
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import logging
|
||||
|
||||
from asyncio import CancelledError, sleep
|
||||
from itertools import count
|
||||
|
||||
@@ -7,7 +6,6 @@ from sanic.exceptions import NotFound
|
||||
from sanic.request import Request
|
||||
from sanic.response import HTTPResponse, json, text
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
# GET
|
||||
# ------------------------------------------------------------ #
|
||||
|
||||
@@ -6,7 +6,6 @@ from sanic import Sanic
|
||||
from sanic.middleware import Middleware, MiddlewareLocation
|
||||
from sanic.response import json
|
||||
|
||||
|
||||
PRIORITY_TEST_CASES = (
|
||||
([0, 1, 2], [1, 1, 1]),
|
||||
([0, 1, 2], [1, 1, None]),
|
||||
|
||||
@@ -2,7 +2,6 @@ import logging
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -4,11 +4,9 @@ import pickle
|
||||
import random
|
||||
import signal
|
||||
import sys
|
||||
|
||||
from asyncio import sleep
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import HOST, PORT
|
||||
|
||||
from sanic import Blueprint, text
|
||||
|
||||
@@ -10,7 +10,6 @@ from sanic.constants import HTTP_METHODS
|
||||
from sanic.exceptions import URLBuildError
|
||||
from sanic.response import text
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
# UTF-8
|
||||
# ------------------------------------------------------------ #
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
import secrets
|
||||
import sys
|
||||
|
||||
from contextlib import suppress
|
||||
from subprocess import PIPE, Popen, TimeoutExpired
|
||||
from tempfile import TemporaryDirectory
|
||||
@@ -11,7 +10,6 @@ from time import sleep
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
# We need to interrupt the autoreloader without killing it, so that the server gets terminated
|
||||
# https://stefan.sofa-rockers.org/2013/08/15/handling-sub-process-hierarchies-python-linux-os-x/
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import uuid
|
||||
|
||||
from unittest.mock import Mock
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import random
|
||||
|
||||
from sanic.response import json
|
||||
|
||||
|
||||
try:
|
||||
from ujson import loads
|
||||
except ImportError:
|
||||
|
||||
@@ -8,7 +8,6 @@ from sanic.response import json, text
|
||||
from sanic.views import HTTPMethodView
|
||||
from sanic.views import stream as stream_decorator
|
||||
|
||||
|
||||
data = "abc" * 1_000_000
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import base64
|
||||
import logging
|
||||
|
||||
from json import dumps as json_dumps
|
||||
from json import loads as json_loads
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import (
|
||||
ASGI_BASE_URL,
|
||||
ASGI_PORT,
|
||||
|
||||
@@ -2,7 +2,6 @@ import asyncio
|
||||
import inspect
|
||||
import os
|
||||
import time
|
||||
|
||||
from collections import namedtuple
|
||||
from datetime import datetime, timedelta
|
||||
from email.utils import formatdate, parsedate_to_datetime
|
||||
@@ -14,7 +13,6 @@ from typing import Callable, List, Union
|
||||
from urllib.parse import unquote
|
||||
|
||||
import pytest
|
||||
|
||||
from aiofiles import os as async_os
|
||||
from pytest import LogCaptureFixture
|
||||
|
||||
@@ -33,7 +31,6 @@ from sanic.response import (
|
||||
text,
|
||||
)
|
||||
|
||||
|
||||
JSON_DATA = {"ok": True}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
|
||||
from functools import partial
|
||||
from unittest.mock import Mock
|
||||
|
||||
@@ -10,7 +9,6 @@ from sanic.exceptions import SanicException
|
||||
from sanic.response import json as json_response
|
||||
from sanic.response.types import JSONResponse
|
||||
|
||||
|
||||
JSON_BODY = {"ok": True}
|
||||
json_dumps = partial(json.dumps, separators=(",", ":"))
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from time import sleep
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -2,7 +2,6 @@ import asyncio
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import (
|
||||
InvalidUsage,
|
||||
ParameterNameConflicts,
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import asyncio
|
||||
import signal
|
||||
|
||||
from contextlib import closing
|
||||
from socket import socket
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import HOST, PORT
|
||||
|
||||
from sanic.exceptions import BadRequest, SanicException
|
||||
|
||||
|
||||
AVAILABLE_LISTENERS = [
|
||||
"before_server_start",
|
||||
"after_server_start",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import logging
|
||||
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import asyncio
|
||||
import os
|
||||
import signal
|
||||
|
||||
from queue import Queue
|
||||
from types import SimpleNamespace
|
||||
from typing import Optional
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import HOST, PORT
|
||||
|
||||
from sanic import Sanic
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import asyncio
|
||||
|
||||
from enum import Enum
|
||||
from inspect import isawaitable
|
||||
from itertools import count
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import NotFound
|
||||
|
||||
from sanic import Blueprint, Sanic, empty
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
from time import gmtime, strftime
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import asyncio
|
||||
|
||||
from asyncio.tasks import Task
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
@@ -9,7 +8,6 @@ from sanic.app import Sanic
|
||||
from sanic.application.state import ApplicationServerInfo, ServerStage
|
||||
from sanic.response import empty
|
||||
|
||||
|
||||
try:
|
||||
from unittest.mock import AsyncMock
|
||||
except ImportError:
|
||||
|
||||
@@ -2,7 +2,6 @@ from sanic_testing.testing import PORT, SanicTestClient
|
||||
|
||||
from sanic.response import json, text
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
# UTF-8
|
||||
# ------------------------------------------------------------ #
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import asyncio
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -3,7 +3,6 @@ import os
|
||||
import ssl
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from contextlib import contextmanager
|
||||
from multiprocessing import Event
|
||||
from pathlib import Path
|
||||
@@ -11,11 +10,9 @@ from unittest.mock import Mock, patch
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import HOST, PORT, SanicTestClient
|
||||
|
||||
import sanic.http.tls.creators
|
||||
|
||||
from sanic import Sanic
|
||||
from sanic.application.constants import Mode
|
||||
from sanic.compat import use_context
|
||||
@@ -31,7 +28,6 @@ from sanic.http.tls.creators import (
|
||||
from sanic.response import text
|
||||
from sanic.worker.loader import CertLoader
|
||||
|
||||
|
||||
current_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
localhost_dir = os.path.join(current_dir, "certs/localhost")
|
||||
password_dir = os.path.join(current_dir, "certs/password")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import NotFound
|
||||
|
||||
from sanic.signals import RESERVED_NAMESPACES
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from asyncio import AbstractEventLoop, sleep
|
||||
from string import ascii_lowercase
|
||||
|
||||
import httpcore
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from pytest import LogCaptureFixture
|
||||
|
||||
from sanic import Sanic
|
||||
@@ -17,7 +15,6 @@ from sanic.compat import use_context
|
||||
from sanic.request import Request
|
||||
from sanic.response import text
|
||||
|
||||
|
||||
# import platform
|
||||
# import subprocess
|
||||
# import sys
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import string
|
||||
|
||||
from urllib.parse import parse_qsl, urlsplit
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import HOST as test_host
|
||||
from sanic_testing.testing import PORT as test_port
|
||||
|
||||
@@ -13,7 +11,6 @@ from sanic.exceptions import URLBuildError
|
||||
from sanic.response import text
|
||||
from sanic.views import HTTPMethodView
|
||||
|
||||
|
||||
URL_FOR_ARGS1 = {"arg1": ["v1", "v2"]}
|
||||
URL_FOR_VALUE1 = "/myurl?arg1=v1&arg1=v2"
|
||||
URL_FOR_ARGS2 = {"arg1": ["v1", "v2"], "_anchor": "anchor"}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing.testing import SanicTestClient
|
||||
|
||||
from sanic.blueprints import Blueprint
|
||||
|
||||
@@ -2,7 +2,6 @@ from json import dumps as json_dumps
|
||||
|
||||
from sanic.response import text
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
# UTF-8
|
||||
# ------------------------------------------------------------ #
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
|
||||
from sanic_routing.exceptions import RouteExists
|
||||
|
||||
from sanic import Sanic
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import re
|
||||
|
||||
from asyncio import Event, Queue, TimeoutError
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
import pytest
|
||||
|
||||
from websockets.frames import CTRL_OPCODES, DATA_OPCODES, Frame
|
||||
|
||||
from sanic.exceptions import ServerError
|
||||
from sanic.server.websockets.frame import WebsocketFrameAssembler
|
||||
|
||||
|
||||
try:
|
||||
from unittest.mock import AsyncMock
|
||||
except ImportError:
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
from typing import Any, Callable, Coroutine
|
||||
|
||||
import pytest
|
||||
|
||||
from websockets.client import WebSocketClientProtocol
|
||||
|
||||
from sanic import Request, Sanic, Websocket
|
||||
|
||||
|
||||
MimicClientType = Callable[
|
||||
[WebSocketClientProtocol], Coroutine[None, None, Any]
|
||||
]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from sanic import Sanic
|
||||
|
||||
|
||||
app = Sanic("test")
|
||||
reveal_type(app)
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
# flake8: noqa: E501
|
||||
|
||||
import subprocess
|
||||
|
||||
from pathlib import Path
|
||||
from typing import List, Tuple
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
CURRENT_DIR = Path(__file__).parent
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ from unittest.mock import Mock, patch
|
||||
from urllib.error import URLError
|
||||
|
||||
import pytest
|
||||
|
||||
from sanic_testing import TestManager
|
||||
|
||||
from sanic.cli.inspector_client import InspectorClient
|
||||
@@ -16,7 +15,6 @@ from sanic.helpers import Default
|
||||
from sanic.log import Colors
|
||||
from sanic.worker.inspector import Inspector
|
||||
|
||||
|
||||
DATA = {
|
||||
"info": {
|
||||
"packages": ["foo"],
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import sys
|
||||
|
||||
from os import getcwd
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
@@ -10,7 +9,6 @@ import pytest
|
||||
from sanic.app import Sanic
|
||||
from sanic.worker.loader import AppLoader, CertLoader
|
||||
|
||||
|
||||
STATIC = Path.cwd() / "tests" / "static"
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ from sanic.exceptions import ServerKilled
|
||||
from sanic.worker.constants import RestartOrder
|
||||
from sanic.worker.manager import WorkerManager
|
||||
|
||||
|
||||
if not OS_IS_WINDOWS:
|
||||
from signal import SIGKILL
|
||||
else:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import sys
|
||||
|
||||
from multiprocessing import Event
|
||||
from os import environ, getpid
|
||||
from typing import Any, Dict, Type, Union
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import re
|
||||
import signal
|
||||
import threading
|
||||
|
||||
from asyncio import Event
|
||||
from logging import DEBUG
|
||||
from pathlib import Path
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
# 38->
|
||||
|
||||
import logging
|
||||
|
||||
from ctypes import c_int32
|
||||
from multiprocessing import Pipe, Queue, Value
|
||||
from os import environ
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import logging
|
||||
|
||||
from os import environ
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user