Skip to content

Commit 7b331bd

Browse files
committed
get postgres connection params for tests from environment
1 parent cc62670 commit 7b331bd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/postgres_conf.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
import os
2+
13
from piccolo.engine.postgres import PostgresEngine
24
from piccolo.conf.apps import AppRegistry
35

46

57
DB = PostgresEngine(
6-
{
7-
"host": "localhost",
8-
"database": "piccolo",
9-
"user": "piccolo",
10-
"password": "piccolo",
8+
config={
9+
"host": os.environ.get("PG_HOST", "localhost"),
10+
"port": os.environ.get("PG_PORT", "5432"),
11+
"user": os.environ.get("PG_USER", "postgres"),
12+
"password": os.environ.get("PG_PASSWORD", ""),
13+
"database": os.environ.get("PG_DATABASE", "piccolo"),
1114
}
1215
)
1316

0 commit comments

Comments
 (0)