From 592d0ccbfbd6a4c4bd11d40d0bd3ebe4806783ae Mon Sep 17 00:00:00 2001 From: Ruben van Staveren Date: Sun, 15 Mar 2026 15:02:13 +0100 Subject: [PATCH] Move tests to their own folder --- .gitea/workflows/python-coverage.yml | 2 +- tests/pytest.ini | 2 ++ {app => tests}/test_iplookup.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 tests/pytest.ini rename {app => tests}/test_iplookup.py (99%) 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)