📝 Update markdown includes format (#1254)

This commit is contained in:
Sebastián Ramírez
2024-12-22 14:30:05 +00:00
committed by GitHub
parent 0c65fed61b
commit 5100200bea
39 changed files with 213 additions and 10659 deletions

View File

@@ -14,13 +14,7 @@ We will use the application with the hero models, but without team models, and w
Now we will see how useful it is to have this session dependency. ✨
/// details | 👀 Full file preview
```Python
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/main.py!}
```
///
{* ./docs_src/tutorial/fastapi/app_testing/tutorial001/main.py ln[0] *}
## File Structure
@@ -304,21 +298,7 @@ But normally we will create **lots of other test functions**. And now all the bo
Let's add some more tests:
```Python hl_lines="3 22"
# Code above omitted 👆
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py[ln:30-58]!}
# Code below omitted 👇
```
/// details | 👀 Full file preview
```Python
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py!}
```
///
{* ./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py ln[30:58] hl[30,49] *}
/// tip
@@ -338,23 +318,7 @@ For these examples, **that would have been simpler**, there's no need to separat
But for the next test function, we will require **both fixtures**, the **client** and the **session**.
```Python hl_lines="6 10"
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py[ln:1-6]!}
# Code here omitted 👈
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py[ln:61-81]!}
# Code below omitted 👇
```
/// details | 👀 Full file preview
```Python
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py!}
```
///
{* ./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py ln[1:6,61:81] hl[6,61] *}
In this test function, we want to check that the *path operation* to **read a list of heroes** actually sends us heroes.
@@ -380,19 +344,7 @@ The function for the **client fixture** and the actual testing function will **b
Using the same ideas, requiring the fixtures, creating data that we need for the tests, etc., we can now add the rest of the tests. They look quite similar to what we have done up to now.
```Python hl_lines="3 18 33"
# Code above omitted 👆
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py[ln:84-125]!}
```
/// details | 👀 Full file preview
```Python
{!./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py!}
```
///
{* ./docs_src/tutorial/fastapi/app_testing/tutorial001/test_main.py ln[84:125] hl[84,99,114] *}
## Run the Tests