Browse Source

⬆ Upgrade isort to version 5.x.x (#1670)

* Update isort script to match changes in the new release, isort v5.0.2

* Downgrade isort to version v4.3.21

* Add an alternative flag to --recursive in isort v5.0.2

* Add isort config file

* 🚚 Import from docs_src for tests

* 🎨 Format dependencies.utils

* 🎨 Remove isort combine_as_imports, keep black profile

* 🔧 Update isort config, use pyproject.toml, Black profile

* 🔧 Update format scripts to use explicit directories to format

otherwise it would try to format venv env directories, I have several with different Python versions

* 🎨 Format NoSQL tutorial after re-sorting imports

* 🎨 Fix format for __init__.py

Co-authored-by: Sebastián Ramírez <[email protected]>
pull/1601/head
Brian Mboya 5 years ago
committed by GitHub
parent
commit
fe453f80ed
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      docs/en/docs/advanced/nosql-databases.md
  2. 5
      docs_src/nosql_databases/tutorial001.py
  3. 2
      fastapi/dependencies/utils.py
  4. 6
      fastapi/security/http.py
  5. 3
      fastapi/security/oauth2.py
  6. 2
      fastapi/utils.py
  7. 4
      pyproject.toml
  8. 2
      scripts/format-imports.sh
  9. 2
      scripts/format.sh
  10. 2
      scripts/lint.sh
  11. 2
      tests/test_tutorial/test_additional_responses/test_tutorial001.py
  12. 2
      tests/test_tutorial/test_additional_responses/test_tutorial002.py
  13. 2
      tests/test_tutorial/test_additional_responses/test_tutorial003.py
  14. 2
      tests/test_tutorial/test_additional_responses/test_tutorial004.py
  15. 2
      tests/test_tutorial/test_additional_status_codes/test_tutorial001.py
  16. 2
      tests/test_tutorial/test_advanced_middleware/test_tutorial001.py
  17. 2
      tests/test_tutorial/test_advanced_middleware/test_tutorial002.py
  18. 2
      tests/test_tutorial/test_advanced_middleware/test_tutorial003.py
  19. 2
      tests/test_tutorial/test_async_sql_databases/test_tutorial001.py
  20. 2
      tests/test_tutorial/test_background_tasks/test_tutorial001.py
  21. 2
      tests/test_tutorial/test_background_tasks/test_tutorial002.py
  22. 2
      tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py
  23. 2
      tests/test_tutorial/test_behind_a_proxy/test_tutorial002.py
  24. 2
      tests/test_tutorial/test_bigger_applications/test_main.py
  25. 2
      tests/test_tutorial/test_body/test_tutorial001.py
  26. 2
      tests/test_tutorial/test_body_fields/test_tutorial001.py
  27. 2
      tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
  28. 2
      tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
  29. 2
      tests/test_tutorial/test_body_nested_models/test_tutorial009.py
  30. 2
      tests/test_tutorial/test_body_updates/test_tutorial001.py
  31. 2
      tests/test_tutorial/test_conditional_openapi/test_tutorial001.py
  32. 2
      tests/test_tutorial/test_cookie_params/test_tutorial001.py
  33. 2
      tests/test_tutorial/test_cors/test_tutorial001.py
  34. 2
      tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py
  35. 2
      tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
  36. 2
      tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py
  37. 2
      tests/test_tutorial/test_custom_response/test_tutorial001b.py
  38. 2
      tests/test_tutorial/test_custom_response/test_tutorial004.py
  39. 2
      tests/test_tutorial/test_custom_response/test_tutorial005.py
  40. 2
      tests/test_tutorial/test_custom_response/test_tutorial006.py
  41. 2
      tests/test_tutorial/test_custom_response/test_tutorial007.py
  42. 4
      tests/test_tutorial/test_custom_response/test_tutorial008.py
  43. 2
      tests/test_tutorial/test_dependencies/test_tutorial001.py
  44. 2
      tests/test_tutorial/test_dependencies/test_tutorial004.py
  45. 2
      tests/test_tutorial/test_dependencies/test_tutorial006.py
  46. 2
      tests/test_tutorial/test_events/test_tutorial001.py
  47. 2
      tests/test_tutorial/test_events/test_tutorial002.py
  48. 2
      tests/test_tutorial/test_extending_openapi/test_tutorial001.py
  49. 2
      tests/test_tutorial/test_extra_data_types/test_tutorial001.py
  50. 2
      tests/test_tutorial/test_extra_models/test_tutorial003.py
  51. 2
      tests/test_tutorial/test_extra_models/test_tutorial004.py
  52. 2
      tests/test_tutorial/test_extra_models/test_tutorial005.py
  53. 2
      tests/test_tutorial/test_first_steps/test_tutorial001.py
  54. 2
      tests/test_tutorial/test_handling_errors/test_tutorial001.py
  55. 2
      tests/test_tutorial/test_handling_errors/test_tutorial002.py
  56. 2
      tests/test_tutorial/test_handling_errors/test_tutorial003.py
  57. 2
      tests/test_tutorial/test_handling_errors/test_tutorial004.py
  58. 2
      tests/test_tutorial/test_handling_errors/test_tutorial005.py
  59. 2
      tests/test_tutorial/test_handling_errors/test_tutorial006.py
  60. 2
      tests/test_tutorial/test_header_params/test_tutorial001.py
  61. 2
      tests/test_tutorial/test_metadata/test_tutorial001.py
  62. 2
      tests/test_tutorial/test_metadata/test_tutorial004.py
  63. 2
      tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py
  64. 2
      tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py
  65. 2
      tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
  66. 2
      tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py
  67. 2
      tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py
  68. 2
      tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py
  69. 2
      tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py
  70. 2
      tests/test_tutorial/test_path_params/test_tutorial004.py
  71. 2
      tests/test_tutorial/test_path_params/test_tutorial005.py
  72. 2
      tests/test_tutorial/test_query_params/test_tutorial005.py
  73. 2
      tests/test_tutorial/test_query_params/test_tutorial006.py
  74. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py
  75. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py
  76. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial012.py
  77. 2
      tests/test_tutorial/test_query_params_str_validations/test_tutorial013.py
  78. 2
      tests/test_tutorial/test_request_files/test_tutorial001.py
  79. 2
      tests/test_tutorial/test_request_files/test_tutorial002.py
  80. 2
      tests/test_tutorial/test_request_forms/test_tutorial001.py
  81. 2
      tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
  82. 2
      tests/test_tutorial/test_response_change_status_code/test_tutorial001.py
  83. 2
      tests/test_tutorial/test_response_cookies/test_tutorial001.py
  84. 2
      tests/test_tutorial/test_response_cookies/test_tutorial002.py
  85. 2
      tests/test_tutorial/test_response_headers/test_tutorial001.py
  86. 2
      tests/test_tutorial/test_response_headers/test_tutorial002.py
  87. 2
      tests/test_tutorial/test_response_model/test_tutorial003.py
  88. 2
      tests/test_tutorial/test_response_model/test_tutorial004.py
  89. 2
      tests/test_tutorial/test_response_model/test_tutorial005.py
  90. 2
      tests/test_tutorial/test_response_model/test_tutorial006.py
  91. 2
      tests/test_tutorial/test_security/test_tutorial001.py
  92. 2
      tests/test_tutorial/test_security/test_tutorial003.py
  93. 2
      tests/test_tutorial/test_security/test_tutorial005.py
  94. 2
      tests/test_tutorial/test_security/test_tutorial006.py
  95. 2
      tests/test_tutorial/test_settings/test_app02.py
  96. 2
      tests/test_tutorial/test_sub_applications/test_tutorial001.py
  97. 2
      tests/test_tutorial/test_wsgi/test_tutorial001.py

16
docs/en/docs/advanced/nosql-databases.md

@ -19,7 +19,7 @@ You can adapt it to any other NoSQL database like:
For now, don't pay attention to the rest, only the imports:
```Python hl_lines="6 7 8"
```Python hl_lines="3 4 5"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -29,7 +29,7 @@ We will use it later as a fixed field `type` in our documents.
This is not required by Couchbase, but is a good practice that will help you afterwards.
```Python hl_lines="10"
```Python hl_lines="9"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -54,7 +54,7 @@ This utility function will:
* Set defaults for timeouts.
* Return it.
```Python hl_lines="13 14 15 16 17 18 19 20 21 22"
```Python hl_lines="12 13 14 15 16 17 18 19 20 21"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -66,7 +66,7 @@ As **Couchbase** "documents" are actually just "JSON objects", we can model them
First, let's create a `User` model:
```Python hl_lines="25 26 27 28 29"
```Python hl_lines="24 25 26 27 28"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -80,7 +80,7 @@ This will have the data that is actually stored in the database.
We don't create it as a subclass of Pydantic's `BaseModel` but as a subclass of our own `User`, because it will have all the attributes in `User` plus a couple more:
```Python hl_lines="32 33 34"
```Python hl_lines="31 32 33"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -100,7 +100,7 @@ Now create a function that will:
By creating a function that is only dedicated to getting your user from a `username` (or any other parameter) independent of your *path operation function*, you can more easily re-use it in multiple parts and also add <abbr title="Automated test, written in code, that checks if another piece of code is working correctly.">unit tests</abbr> for it:
```Python hl_lines="37 38 39 40 41 42 43"
```Python hl_lines="36 37 38 39 40 41 42"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -135,7 +135,7 @@ UserInDB(username="johndoe", hashed_password="some_hash")
### Create the `FastAPI` app
```Python hl_lines="47"
```Python hl_lines="46"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
@ -145,7 +145,7 @@ As our code is calling Couchbase and we are not using the <a href="https://docs.
Also, Couchbase recommends not using a single `Bucket` object in multiple "<abbr title="A sequence of code being executed by the program, while at the same time, or at intervals, there can be others being executed too.">thread</abbr>s", so, we can get just get the bucket directly and pass it to our utility functions:
```Python hl_lines="50 51 52 53 54"
```Python hl_lines="49 50 51 52 53"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```

5
docs_src/nosql_databases/tutorial001.py

@ -1,11 +1,10 @@
from typing import Optional
from fastapi import FastAPI
from pydantic import BaseModel
from couchbase import LOCKMODE_WAIT
from couchbase.bucket import Bucket
from couchbase.cluster import Cluster, PasswordAuthenticator
from fastapi import FastAPI
from pydantic import BaseModel
USERPROFILE_DOC_TYPE = "userprofile"

2
fastapi/dependencies/utils.py

@ -60,9 +60,9 @@ try:
from pydantic.typing import ForwardRef, evaluate_forwardref
except ImportError: # pragma: nocover
# TODO: remove when removing support for Pydantic < 1.0.0
from pydantic import Schema as FieldInfo # type: ignore
from pydantic.fields import Field as ModelField # type: ignore
from pydantic.fields import Required, Shape # type: ignore
from pydantic import Schema as FieldInfo # type: ignore
from pydantic.schema import get_annotation_from_schema # type: ignore
from pydantic.utils import ForwardRef, evaluate_forwardref # type: ignore

6
fastapi/security/http.py

@ -3,10 +3,8 @@ from base64 import b64decode
from typing import Optional
from fastapi.exceptions import HTTPException
from fastapi.openapi.models import (
HTTPBase as HTTPBaseModel,
HTTPBearer as HTTPBearerModel,
)
from fastapi.openapi.models import HTTPBase as HTTPBaseModel
from fastapi.openapi.models import HTTPBearer as HTTPBearerModel
from fastapi.security.base import SecurityBase
from fastapi.security.utils import get_authorization_scheme_param
from pydantic import BaseModel

3
fastapi/security/oauth2.py

@ -1,7 +1,8 @@
from typing import List, Optional
from fastapi.exceptions import HTTPException
from fastapi.openapi.models import OAuth2 as OAuth2Model, OAuthFlows as OAuthFlowsModel
from fastapi.openapi.models import OAuth2 as OAuth2Model
from fastapi.openapi.models import OAuthFlows as OAuthFlowsModel
from fastapi.param_functions import Form
from fastapi.security.base import SecurityBase
from fastapi.security.utils import get_authorization_scheme_param

2
fastapi/utils.py

@ -18,8 +18,8 @@ try:
PYDANTIC_1 = True
except ImportError: # pragma: nocover
# TODO: remove when removing support for Pydantic < 1.0.0
from pydantic.fields import Field as ModelField # type: ignore
from pydantic import Schema as FieldInfo # type: ignore
from pydantic.fields import Field as ModelField # type: ignore
class UndefinedType: # type: ignore
def __repr__(self) -> str:

4
pyproject.toml

@ -91,3 +91,7 @@ all = [
"async_exit_stack",
"async_generator"
]
[tool.isort]
profile = "black"
known_third_party = ["fastapi", "pydantic", "starlette"]

2
scripts/format-imports.sh

@ -2,5 +2,5 @@
set -x
# Sort imports one per line, so autoflake can remove unused imports
isort --recursive --force-single-line-imports --thirdparty fastapi --apply fastapi tests docs_src scripts
isort fastapi tests docs_src scripts --force-single-line-imports
sh ./scripts/format.sh

2
scripts/format.sh

@ -3,4 +3,4 @@ set -x
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place docs_src fastapi tests scripts --exclude=__init__.py
black fastapi tests docs_src scripts
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --thirdparty fastapi --thirdparty pydantic --thirdparty starlette --apply fastapi tests docs_src scripts
isort fastapi tests docs_src scripts

2
scripts/lint.sh

@ -5,4 +5,4 @@ set -x
mypy fastapi
black fastapi tests --check
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --check-only --thirdparty fastapi --thirdparty fastapi --thirdparty pydantic --thirdparty starlette fastapi tests
isort fastapi tests docs_src scripts --check-only

2
tests/test_tutorial/test_additional_responses/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from additional_responses.tutorial001 import app
from docs_src.additional_responses.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_additional_responses/test_tutorial002.py

@ -3,7 +3,7 @@ import shutil
from fastapi.testclient import TestClient
from additional_responses.tutorial002 import app
from docs_src.additional_responses.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_additional_responses/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from additional_responses.tutorial003 import app
from docs_src.additional_responses.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_additional_responses/test_tutorial004.py

@ -3,7 +3,7 @@ import shutil
from fastapi.testclient import TestClient
from additional_responses.tutorial004 import app
from docs_src.additional_responses.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_additional_status_codes/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from additional_status_codes.tutorial001 import app
from docs_src.additional_status_codes.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_advanced_middleware/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from advanced_middleware.tutorial001 import app
from docs_src.advanced_middleware.tutorial001 import app
def test_middleware():

2
tests/test_tutorial/test_advanced_middleware/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from advanced_middleware.tutorial002 import app
from docs_src.advanced_middleware.tutorial002 import app
def test_middleware():

2
tests/test_tutorial/test_advanced_middleware/test_tutorial003.py

@ -1,7 +1,7 @@
from fastapi.responses import PlainTextResponse
from fastapi.testclient import TestClient
from advanced_middleware.tutorial003 import app
from docs_src.advanced_middleware.tutorial003 import app
@app.get("/large")

2
tests/test_tutorial/test_async_sql_databases/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from async_sql_databases.tutorial001 import app
from docs_src.async_sql_databases.tutorial001 import app
openapi_schema = {
"openapi": "3.0.2",

2
tests/test_tutorial/test_background_tasks/test_tutorial001.py

@ -3,7 +3,7 @@ from pathlib import Path
from fastapi.testclient import TestClient
from background_tasks.tutorial001 import app
from docs_src.background_tasks.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_background_tasks/test_tutorial002.py

@ -3,7 +3,7 @@ from pathlib import Path
from fastapi.testclient import TestClient
from background_tasks.tutorial002 import app
from docs_src.background_tasks.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from behind_a_proxy.tutorial001 import app
from docs_src.behind_a_proxy.tutorial001 import app
client = TestClient(app, root_path="/api/v1")

2
tests/test_tutorial/test_behind_a_proxy/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from behind_a_proxy.tutorial002 import app
from docs_src.behind_a_proxy.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_bigger_applications/test_main.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from bigger_applications.app.main import app
from docs_src.bigger_applications.app.main import app
client = TestClient(app)

2
tests/test_tutorial/test_body/test_tutorial001.py

@ -3,7 +3,7 @@ from unittest.mock import patch
import pytest
from fastapi.testclient import TestClient
from body.tutorial001 import app
from docs_src.body.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_body_fields/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from body_fields.tutorial001 import app
from docs_src.body_fields.tutorial001 import app
# TODO: remove when removing support for Pydantic < 1.0.0
try:

2
tests/test_tutorial/test_body_multiple_params/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from body_multiple_params.tutorial001 import app
from docs_src.body_multiple_params.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from body_multiple_params.tutorial003 import app
from docs_src.body_multiple_params.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_body_nested_models/test_tutorial009.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from body_nested_models.tutorial009 import app
from docs_src.body_nested_models.tutorial009 import app
client = TestClient(app)

2
tests/test_tutorial/test_body_updates/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from body_updates.tutorial001 import app
from docs_src.body_updates.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_conditional_openapi/test_tutorial001.py

@ -2,7 +2,7 @@ import importlib
from fastapi.testclient import TestClient
from conditional_openapi import tutorial001
from docs_src.conditional_openapi import tutorial001
openapi_schema = {
"openapi": "3.0.2",

2
tests/test_tutorial/test_cookie_params/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from cookie_params.tutorial001 import app
from docs_src.cookie_params.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_cors/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from cors.tutorial001 import app
from docs_src.cors.tutorial001 import app
def test_cors():

2
tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py

@ -5,7 +5,7 @@ import pytest
from fastapi import Request
from fastapi.testclient import TestClient
from custom_request_and_route.tutorial001 import app
from docs_src.custom_request_and_route.tutorial001 import app
@app.get("/check-class")

2
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_request_and_route.tutorial002 import app
from docs_src.custom_request_and_route.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_request_and_route.tutorial003 import app
from docs_src.custom_request_and_route.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_custom_response/test_tutorial001b.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_response.tutorial001b import app
from docs_src.custom_response.tutorial001b import app
client = TestClient(app)

2
tests/test_tutorial/test_custom_response/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_response.tutorial004 import app
from docs_src.custom_response.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_custom_response/test_tutorial005.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_response.tutorial005 import app
from docs_src.custom_response.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_custom_response/test_tutorial006.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_response.tutorial006 import app
from docs_src.custom_response.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_custom_response/test_tutorial007.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from custom_response.tutorial007 import app
from docs_src.custom_response.tutorial007 import app
client = TestClient(app)

4
tests/test_tutorial/test_custom_response/test_tutorial008.py

@ -2,8 +2,8 @@ from pathlib import Path
from fastapi.testclient import TestClient
from custom_response import tutorial008
from custom_response.tutorial008 import app
from docs_src.custom_response import tutorial008
from docs_src.custom_response.tutorial008 import app
client = TestClient(app)

2
tests/test_tutorial/test_dependencies/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from dependencies.tutorial001 import app
from docs_src.dependencies.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_dependencies/test_tutorial004.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from dependencies.tutorial004 import app
from docs_src.dependencies.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_dependencies/test_tutorial006.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from dependencies.tutorial006 import app
from docs_src.dependencies.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_events/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from events.tutorial001 import app
from docs_src.events.tutorial001 import app
openapi_schema = {
"openapi": "3.0.2",

2
tests/test_tutorial/test_events/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from events.tutorial002 import app
from docs_src.events.tutorial002 import app
openapi_schema = {
"openapi": "3.0.2",

2
tests/test_tutorial/test_extending_openapi/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from extending_openapi.tutorial001 import app
from docs_src.extending_openapi.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_extra_data_types/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from extra_data_types.tutorial001 import app
from docs_src.extra_data_types.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_extra_models/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from extra_models.tutorial003 import app
from docs_src.extra_models.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_extra_models/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from extra_models.tutorial004 import app
from docs_src.extra_models.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_extra_models/test_tutorial005.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from extra_models.tutorial005 import app
from docs_src.extra_models.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_first_steps/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from first_steps.tutorial001 import app
from docs_src.first_steps.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_handling_errors/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from handling_errors.tutorial001 import app
from docs_src.handling_errors.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_handling_errors/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from handling_errors.tutorial002 import app
from docs_src.handling_errors.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_handling_errors/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from handling_errors.tutorial003 import app
from docs_src.handling_errors.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_handling_errors/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from handling_errors.tutorial004 import app
from docs_src.handling_errors.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_handling_errors/test_tutorial005.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from handling_errors.tutorial005 import app
from docs_src.handling_errors.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_handling_errors/test_tutorial006.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from handling_errors.tutorial006 import app
from docs_src.handling_errors.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_header_params/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from header_params.tutorial001 import app
from docs_src.header_params.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_metadata/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from metadata.tutorial001 import app
from docs_src.metadata.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_metadata/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from metadata.tutorial004 import app
from docs_src.metadata.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from openapi_callbacks.tutorial001 import app, invoice_notification
from docs_src.openapi_callbacks.tutorial001 import app, invoice_notification
client = TestClient(app)

2
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from path_operation_advanced_configuration.tutorial001 import app
from docs_src.path_operation_advanced_configuration.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from path_operation_advanced_configuration.tutorial002 import app
from docs_src.path_operation_advanced_configuration.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from path_operation_advanced_configuration.tutorial003 import app
from docs_src.path_operation_advanced_configuration.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from path_operation_advanced_configuration.tutorial004 import app
from docs_src.path_operation_advanced_configuration.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from path_operation_configuration.tutorial005 import app
from docs_src.path_operation_configuration.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from path_operation_configuration.tutorial006 import app
from docs_src.path_operation_configuration.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_params/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from path_params.tutorial004 import app
from docs_src.path_params.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_path_params/test_tutorial005.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from path_params.tutorial005 import app
from docs_src.path_params.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_query_params/test_tutorial005.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from query_params.tutorial005 import app
from docs_src.query_params.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_query_params/test_tutorial006.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from query_params.tutorial006 import app
from docs_src.query_params.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from query_params_str_validations.tutorial010 import app
from docs_src.query_params_str_validations.tutorial010 import app
client = TestClient(app)

2
tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from query_params_str_validations.tutorial011 import app
from docs_src.query_params_str_validations.tutorial011 import app
client = TestClient(app)

2
tests/test_tutorial/test_query_params_str_validations/test_tutorial012.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from query_params_str_validations.tutorial012 import app
from docs_src.query_params_str_validations.tutorial012 import app
client = TestClient(app)

2
tests/test_tutorial/test_query_params_str_validations/test_tutorial013.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from query_params_str_validations.tutorial013 import app
from docs_src.query_params_str_validations.tutorial013 import app
client = TestClient(app)

2
tests/test_tutorial/test_request_files/test_tutorial001.py

@ -2,7 +2,7 @@ import os
from fastapi.testclient import TestClient
from request_files.tutorial001 import app
from docs_src.request_files.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_request_files/test_tutorial002.py

@ -2,7 +2,7 @@ import os
from fastapi.testclient import TestClient
from request_files.tutorial002 import app
from docs_src.request_files.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_request_forms/test_tutorial001.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from request_forms.tutorial001 import app
from docs_src.request_forms.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

@ -3,7 +3,7 @@ from pathlib import Path
from fastapi.testclient import TestClient
from request_forms_and_files.tutorial001 import app
from docs_src.request_forms_and_files.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_change_status_code/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_change_status_code.tutorial001 import app
from docs_src.response_change_status_code.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_cookies/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_cookies.tutorial001 import app
from docs_src.response_cookies.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_cookies/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_cookies.tutorial002 import app
from docs_src.response_cookies.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_headers/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_headers.tutorial001 import app
from docs_src.response_headers.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_headers/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_headers.tutorial002 import app
from docs_src.response_headers.tutorial002 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_model/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_model.tutorial003 import app
from docs_src.response_model.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_model/test_tutorial004.py

@ -1,7 +1,7 @@
import pytest
from fastapi.testclient import TestClient
from response_model.tutorial004 import app
from docs_src.response_model.tutorial004 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_model/test_tutorial005.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_model.tutorial005 import app
from docs_src.response_model.tutorial005 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_model/test_tutorial006.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from response_model.tutorial006 import app
from docs_src.response_model.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_security/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from security.tutorial001 import app
from docs_src.security.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_security/test_tutorial003.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from security.tutorial003 import app
from docs_src.security.tutorial003 import app
client = TestClient(app)

2
tests/test_tutorial/test_security/test_tutorial005.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from security.tutorial005 import (
from docs_src.security.tutorial005 import (
app,
create_access_token,
fake_users_db,

2
tests/test_tutorial/test_security/test_tutorial006.py

@ -3,7 +3,7 @@ from base64 import b64encode
from fastapi.testclient import TestClient
from requests.auth import HTTPBasicAuth
from security.tutorial006 import app
from docs_src.security.tutorial006 import app
client = TestClient(app)

2
tests/test_tutorial/test_settings/test_app02.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from settings.app02 import main, test_main
from docs_src.settings.app02 import main, test_main
client = TestClient(main.app)

2
tests/test_tutorial/test_sub_applications/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from sub_applications.tutorial001 import app
from docs_src.sub_applications.tutorial001 import app
client = TestClient(app)

2
tests/test_tutorial/test_wsgi/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from wsgi.tutorial001 import app
from docs_src.wsgi.tutorial001 import app
client = TestClient(app)

Loading…
Cancel
Save