Skip to content

Commit

Permalink
UPDATE conftest.py - run tests on local postgres instance
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVonNeumann committed Mar 4, 2024
1 parent e849789 commit c2cebba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ jobs:

runs-on: ubuntu-latest

services:
postgres:
image: postgres

env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres

options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def start_application():
return app


SQLALCHEMY_DATABASE_URL = "sqlite:///./test_db.db"
SQLALCHEMY_DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/postgres"
engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
SQLALCHEMY_DATABASE_URL, echo=True, future=True
)
# Use connect_args parameter only with sqlite
SessionTesting = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Expand Down

0 comments on commit c2cebba

Please sign in to comment.