Skip to content

Commit 90a79b4

Browse files
author
¨eadwinCode¨
committed
fixed failing test coverage
1 parent 5f5e0a9 commit 90a79b4

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ repos:
1414
name: Code Formatting
1515
entry: "make fmt"
1616
types: [python]
17-
language_version: python3.8
17+
language_version: python3.10
1818
language: python
1919
- id: code_linting
2020
args: [ ]
2121
name: Code Linting
2222
entry: "make lint"
2323
types: [ python ]
24-
language_version: python3.8
24+
language_version: python3.10
2525
language: python
2626
- repo: https://github.com/pre-commit/pre-commit-hooks
2727
rev: v2.3.0

ellar/common/params/decorators/inject.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ def Key(cls, key: str) -> str:
5252

5353
@classmethod
5454
def __class_getitem__(cls, args: t.Union[t.Any, t.Tuple[t.Type, str]]) -> t.Any:
55-
5655
if isinstance(args, tuple):
5756
base_type, _str_default_resolve = args
5857
default_resolver = _DEFAULT_RESOLVERS.get(_str_default_resolve)
5958
else:
6059
if isinstance(args, str):
60+
# annotation = t.ForwardRef(args)
61+
# annotation = t.evaluate_forwardref(annotation, globals(), globals())
6162
args = globals().get(args, args)
6263
base_type = args
6364
default_resolver = _DEFAULT_RESOLVERS.get(base_type)

ellar/core/lifespan.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ async def lifespan(self, app: "App") -> t.AsyncIterator[t.Any]:
6060
async with self._lifespan_context(app) as ctx: # type:ignore[attr-defined]
6161
yield ctx
6262
finally:
63-
6463
logger.logger.debug("Executing Modules Shutdown Handlers")
6564
async with create_task_group() as tg:
6665
tg.start_soon(self.run_all_shutdown_actions, app)

tests/test_routing/test_body_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010

1111
@post("/product")
12-
async def create_item(product: Product):
12+
async def create_item(
13+
product: "Product",
14+
): # just to test get_typed_annotation in ellar.common.params.args.base
1315
return product
1416

1517

0 commit comments

Comments
 (0)