diff --git a/.gitea/workflows/python-coverage.yml b/.gitea/workflows/python-coverage.yml index 92435a9..565d8df 100644 --- a/.gitea/workflows/python-coverage.yml +++ b/.gitea/workflows/python-coverage.yml @@ -33,7 +33,7 @@ jobs: - name: Run tests with coverage run: | - pytest --cov=./ --cov-report=term --cov-report=xml --cov-report=html --junitxml=report.xml app + pytest --cov=./ --cov-report=term --cov-report=xml --cov-report=html --junitxml=report.xml tests - name: Upload coverage artifacts uses: actions/upload-artifact@v3 diff --git a/tests/pytest.ini b/tests/pytest.ini new file mode 100644 index 0000000..c6f165f --- /dev/null +++ b/tests/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath = ../app diff --git a/app/test_iplookup.py b/tests/test_iplookup.py similarity index 99% rename from app/test_iplookup.py rename to tests/test_iplookup.py index 139aaff..e5ea522 100644 --- a/app/test_iplookup.py +++ b/tests/test_iplookup.py @@ -9,7 +9,7 @@ from operator import itemgetter from faker import Faker from fastapi.testclient import TestClient -from .main import app +from main import app # Set up logging logging.basicConfig(level=logging.INFO)