3 changed files with 20 additions and 6 deletions
@ -0,0 +1,7 @@ |
|||
from decimal import Decimal |
|||
|
|||
from fastapi import Query |
|||
|
|||
|
|||
def create_item(price: Decimal = Query(..., max_digits=5, decimal_places=2)): |
|||
return {"price": price} |
|||
@ -1,6 +1,11 @@ |
|||
import pytest |
|||
from docs_src.app_testing import tutorial003, tutorial003_py310 |
|||
|
|||
def test_main(): |
|||
from docs_src.app_testing.tutorial003_py310 import test_read_items |
|||
test_read_items() |
|||
|
|||
def test_tutorial003(): |
|||
# This covers the base version (tutorial003.py) |
|||
tutorial003.test_read_items() |
|||
|
|||
|
|||
def test_tutorial003_py310(): |
|||
# This covers the modern version (tutorial003_py310.py) |
|||
tutorial003_py310.test_read_items() |
|||
|
|||
Loading…
Reference in new issue