mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-11 21:16:45 +00:00
📝 Add note on installing and running pytest
This commit is contained in:
parent
c9ef7bd6dc
commit
ab6dd60997
1 changed files with 16 additions and 0 deletions
|
|
@ -67,3 +67,19 @@ When you need your event handlers (`startup` and `shutdown`) to run in your test
|
||||||
```Python hl_lines="9 10 11 12 20 21 22 23 24"
|
```Python hl_lines="9 10 11 12 20 21 22 23 24"
|
||||||
{!./src/app_testing/tutorial003.py!}
|
{!./src/app_testing/tutorial003.py!}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Run it
|
||||||
|
|
||||||
|
After that, you just need to install `pytest`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install pytest
|
||||||
|
```
|
||||||
|
|
||||||
|
It will detect the files and tests automatically, execute them, and report the results back to you.
|
||||||
|
|
||||||
|
Run the tests with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pytest
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue