Browse Source
Add return annotations to dependency utils tests
pull/15234/head
giria660
3 months ago
No known key found for this signature in database
GPG Key ID: 3D8290B3CD372BA4
1 changed files with
2 additions and
2 deletions
-
tests/test_dependencies_utils.py
|
|
@ -4,14 +4,14 @@ from fastapi import Depends, params |
|
|
from fastapi.dependencies.utils import get_typed_annotation |
|
|
from fastapi.dependencies.utils import get_typed_annotation |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_typed_annotation(): |
|
|
def test_get_typed_annotation() -> None: |
|
|
# For coverage |
|
|
# For coverage |
|
|
annotation = "None" |
|
|
annotation = "None" |
|
|
typed_annotation = get_typed_annotation(annotation, globals()) |
|
|
typed_annotation = get_typed_annotation(annotation, globals()) |
|
|
assert typed_annotation is None |
|
|
assert typed_annotation is None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_typed_annotation_falls_back_to_lenient_forwardref_resolution(): |
|
|
def test_get_typed_annotation_falls_back_to_lenient_forwardref_resolution() -> None: |
|
|
def dependency() -> None: |
|
|
def dependency() -> None: |
|
|
return None |
|
|
return None |
|
|
|
|
|
|
|
|
|