File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,23 @@ help: ## Show this help
44
55.PHONY : build
66build : # # Build project with compose
7- docker- compose build
7+ docker compose build
88
99.PHONY : up
1010up : # # Run project with compose
11- docker- compose up
11+ docker compose up
1212
1313.PHONY : down
1414down : # # Reset project containers with compose
15- docker- compose down -v --remove-orphans
15+ docker compose down -v --remove-orphans
1616
1717.PHONY : test
1818test : # # Run project tests
19- docker- compose run --rm web pytest -vv tests
19+ docker compose -f compose.yml run --rm web pytest -vv tests
2020
2121.PHONY : test-snapshot
2222test-snapshot : # # Run project tests
23- docker- compose run --rm web pytest -vv -- inline-snapshot=create
23+ docker compose -f compose.yml run web pytest -- inline-snapshot=create tests
2424
2525.PHONY : mypy
2626mypy : # # mypy check.
@@ -41,5 +41,5 @@ format: ## format project code.
4141
4242.PHONY : clean
4343clean : # # Clean Reset project containers and volumes with compose
44- docker- compose down -v --remove-orphans | true
45- docker- compose rm -f
44+ docker compose down -v --remove-orphans | true
45+ docker compose rm -f
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ services:
1111 "
1212 volumes:
1313 - ./greens:/app/greens
14+ - ./tests:/app/tests
1415 ports:
1516 - " 8989:8989"
1617 depends_on :
Original file line number Diff line number Diff line change 11from collections .abc import AsyncGenerator
22
33import pytest
4- from httpx import AsyncClient
4+ from httpx import AsyncClient , ASGITransport
55
66from greens .config import settings as global_settings
77from greens .main import app , init_mongo
@@ -18,10 +18,13 @@ def anyio_backend(request):
1818
1919
2020@pytest .fixture
21- async def client () -> AsyncGenerator :
21+ async def client () -> AsyncGenerator [AsyncClient ]:
22+ transport = ASGITransport (
23+ app = app ,
24+ )
2225 async with AsyncClient (
23- app = app ,
2426 base_url = "http://testserver" ,
27+ transport = transport ,
2528 ) as client :
2629 app .state .logger = get_logger (__name__ )
2730 app .state .mongo_client , app .state .mongo_db , app .state .mongo_collection = (
You can’t perform that action at this time.
0 commit comments