Skip to content

Commit

Permalink
updates tests in dv2
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Aug 21, 2024
1 parent dfed371 commit 9be1445
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
21 changes: 5 additions & 16 deletions services/director-v2/requirements/_test.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ docker
Faker
flaky
pytest
pytest-asyncio
# ----
# Overcomes "Known issues" in https://github.com/pytest-dev/pytest-asyncio/releases/tag/v0.23.8
# IMPORTANT: This constraint can be removed when `test_pytest_asyncio_known_issue` passes with the new update of pytest-asyncio
pytest-asyncio<0.23
# ----
pytest-cov
pytest-docker
pytest-icdiff
Expand All @@ -32,18 +36,3 @@ sqlalchemy[mypy] # adds Mypy / Pep-484 Support for ORM Mappings SEE https://docs
types-networkx
types-psycopg2
types-PyYAML
# NOTE: What test client to use for fastapi-based apps?
#
# fastapi comes with a default test client: fatapi.testclient.TestClient (SEE https://fastapi.tiangolo.com/tutorial/testing/)
# which is essentially an indirection to starlette.testclient (SEE https://www.starlette.io/testclient/)
#
# the limitation of that client is that it is fd synchronous.
#
# There are two options in place:
# a) fastapi recommends to use httpx and create your own AsyncTestClient: https://fastapi.tiangolo.com/advanced/async-tests/
# PROS: can use respx to mock responses, used to httpx API
# CONS: do it yourself, does not include app member out-of-the-box
# b) use generic Async ASGI TestClient library: https://github.com/vinissimus/async-asgi-testclient
# PROS: generic closed solution, has 'app' member , requests-like API (i.e. equivalent to starletter TESTClient)
# CONS: basically does not have the PROS from a), adds extra deps to 'requests' lib.
#
2 changes: 1 addition & 1 deletion services/director-v2/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pytest==8.3.2
# pytest-icdiff
# pytest-mock
# pytest-xdist
pytest-asyncio==0.23.8
pytest-asyncio==0.21.2
# via
# -c requirements/../../../requirements/constraints.txt
# -r requirements/_test.in
Expand Down

0 comments on commit 9be1445

Please sign in to comment.