Skip to content

Commit

Permalink
chore: make cmc / cg api tests context managed
Browse files Browse the repository at this point in the history
  • Loading branch information
robcxyz committed Oct 29, 2024
1 parent 8c73b13 commit dc06131
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/integration/api/test_api_cmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
from balanced_backend.config import settings


@pytest.fixture
def client(event_loop) -> TestClient:
from balanced_backend.main_api import app
with TestClient(app) as client:
yield client


@pytest.mark.anyio
def test_api_get_cmc_summary(client: TestClient):
response = client.get(f"{settings.REST_PREFIX}/coin-market-cap/summary")
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/api/test_api_coingecko.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

from balanced_backend.config import settings

@pytest.fixture
def client(event_loop) -> TestClient:
from balanced_backend.main_api import app
with TestClient(app) as client:
yield client


@pytest.mark.anyio
def test_api_get_coingecko_summary(client: TestClient):
Expand Down

0 comments on commit dc06131

Please sign in to comment.