Skip to content

Commit

Permalink
Use and pin black 20 (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayH5 committed Sep 5, 2020
1 parent c566fc6 commit 8729e9f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ujson

# Testing
autoflake
black
black==20.8b1
databases[sqlite]
isort==5.*
mypy
Expand Down
4 changes: 2 additions & 2 deletions starlette/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ def build_middleware_stack(self) -> ASGIApp:
exception_handlers[key] = value

middleware = (
[Middleware(ServerErrorMiddleware, handler=error_handler, debug=debug,)]
[Middleware(ServerErrorMiddleware, handler=error_handler, debug=debug)]
+ self.user_middleware
+ [
Middleware(
ExceptionMiddleware, handlers=exception_handlers, debug=debug,
ExceptionMiddleware, handlers=exception_handlers, debug=debug
)
]
)
Expand Down
6 changes: 3 additions & 3 deletions starlette/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def __init__(
self.file_values = self._read_file(env_file)

def __call__(
self, key: str, cast: typing.Callable = None, default: typing.Any = undefined,
self, key: str, cast: typing.Callable = None, default: typing.Any = undefined
) -> typing.Any:
return self.get(key, cast, default)

def get(
self, key: str, cast: typing.Callable = None, default: typing.Any = undefined,
self, key: str, cast: typing.Callable = None, default: typing.Any = undefined
) -> typing.Any:
if key in self.environ:
value = self.environ[key]
Expand All @@ -87,7 +87,7 @@ def _read_file(self, file_name: typing.Union[str, Path]) -> typing.Dict[str, str
return file_values

def _perform_cast(
self, key: str, value: typing.Any, cast: typing.Callable = None,
self, key: str, value: typing.Any, cast: typing.Callable = None
) -> typing.Any:
if cast is None or value is None:
return value
Expand Down
2 changes: 1 addition & 1 deletion tests/middleware/test_lifespan.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run_shutdown():
app = Router(
on_startup=[run_startup],
on_shutdown=[run_shutdown],
routes=[Route("/", hello_world),],
routes=[Route("/", hello_world)],
)

assert not startup_complete
Expand Down
2 changes: 1 addition & 1 deletion tests/test_graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_graphql_async():
@pytest.fixture
def old_style_async_app(event_loop) -> GraphQLApp:
old_style_async_app = GraphQLApp(
schema=async_schema, executor=AsyncioExecutor(loop=event_loop),
schema=async_schema, executor=AsyncioExecutor(loop=event_loop)
)
return old_style_async_app

Expand Down
2 changes: 1 addition & 1 deletion tests/test_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def test_url_for_with_root_path():


double_mount_routes = [
Mount("/mount", name="mount", routes=[Mount("/static", ..., name="static")],),
Mount("/mount", name="mount", routes=[Mount("/static", ..., name="static")]),
]


Expand Down

0 comments on commit 8729e9f

Please sign in to comment.