Browse Source

✏️ Fix typo in dependencies with yield source examples (#10847)

pull/10851/head
Sebastián Ramírez 1 year ago
committed by GitHub
parent
commit
dd790c34ff
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs_src/dependencies/tutorial008b.py
  2. 2
      docs_src/dependencies/tutorial008b_an.py
  3. 2
      docs_src/dependencies/tutorial008b_an_py39.py
  4. 2
      tests/test_tutorial/test_dependencies/test_tutorial008b.py
  5. 2
      tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
  6. 2
      tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py

2
docs_src/dependencies/tutorial008b.py

@ -17,7 +17,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")

2
docs_src/dependencies/tutorial008b_an.py

@ -18,7 +18,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")

2
docs_src/dependencies/tutorial008b_an_py39.py

@ -19,7 +19,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")

2
tests/test_tutorial/test_dependencies/test_tutorial008b.py

@ -14,7 +14,7 @@ def test_get_no_item():
def test_owner_error():
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
assert response.json() == {"detail": "Onwer error: Rick"}
assert response.json() == {"detail": "Owner error: Rick"}
def test_get_item():

2
tests/test_tutorial/test_dependencies/test_tutorial008b_an.py

@ -14,7 +14,7 @@ def test_get_no_item():
def test_owner_error():
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
assert response.json() == {"detail": "Onwer error: Rick"}
assert response.json() == {"detail": "Owner error: Rick"}
def test_get_item():

2
tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py

@ -14,7 +14,7 @@ def test_get_no_item():
def test_owner_error():
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
assert response.json() == {"detail": "Onwer error: Rick"}
assert response.json() == {"detail": "Owner error: Rick"}
def test_get_item():

Loading…
Cancel
Save