Update test.yml

This commit is contained in:
Daniel Grams 2021-01-26 15:00:05 +01:00
parent e967e1fedd
commit 73baf10607
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
name: Tests
# Controls when the action will run.
# Controls when the action will run.
on: [workflow_dispatch]
jobs:
@ -23,7 +23,7 @@ jobs:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: gsevpt_tests
POSTGRES_DB: gsevpt_tests
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
@ -41,5 +41,4 @@ jobs:
- name: Run tests
run: pytest --cov-report=html --cov=project tests/test___init__.py
env:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
TEST_DATABASE_URL: postgresql://postgres:postgres@postgres/gsevpt_tests

View File

@ -5,7 +5,9 @@ from .seeder import Seeder
def pytest_generate_tests(metafunc):
os.environ["DATABASE_URL"] = "postgresql://postgres@localhost/gsevpt_tests"
os.environ["DATABASE_URL"] = os.environ.get(
"TEST_DATABASE_URL", "postgresql://postgres@localhost/gsevpt_tests"
)
@pytest.fixture

View File

@ -1,7 +1,6 @@
def test_mail_server():
import os
os.environ["DATABASE_URL"] = "postgresql://postgres@localhost/gsevpt_tests"
os.environ["MAIL_SERVER"] = "mailserver.com"
from project import app