tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.58k stars 378 forks source link

Update fastapi example to avoid httpx warning: `The "app" shortcut is now deprecated.` #1606

Closed waketzheng closed 4 months ago

waketzheng commented 4 months ago

Unittest of fastapi example print warning message with newer version httpx:

examples/fastapi/_tests.py::test_create_user
  /Users/mac10.12/Library/Caches/pypoetry/virtualenvs/tortoise-orm-iT379CwK-py3.10/lib/python3.10/site-packages/httpx/_client.py:1426: DeprecationWarning: The 'app' shortcut is now deprecated. Use the explicit style 'transport=ASGITransport(app=...)' instead.
    warnings.warn(message, DeprecationWarning)

Description

How to reproduce:

cd examples/fastapi
pytest _tests.py

How Has This Been Tested?

make ci && cd examples/fastapi && pytest _tests.py

Checklist: