Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cyri113 committed Sep 13, 2024
1 parent 18b008f commit c86a12c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: coverage run -m pytest
coverageCommand: coverage run -m pytest app

build-push:
name: Build + Push Image
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__
.pytest_cache
.pytest_cache
.coverage
10 changes: 5 additions & 5 deletions app/test_main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from fastapi.testclient import TestClient
from main import app

client = TestClient(app)


def test_route():
response = client.post("/test", json={"text": "Is this a test?"})
assert response.status_code == 200
assert response.json()["label"] == "QUESTION"

with TestClient(app) as client:
response = client.post("/test", json={"text": "Is this a test?"})
assert response.status_code == 200
assert response.json()["label"] == "QUESTION"

0 comments on commit c86a12c

Please sign in to comment.