File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
tests/test_database_functions Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 8
8
build :
9
9
env :
10
10
USING_COVERAGE : " 3.12"
11
- DATABASE_URL : " postgresql://postgres:postgres@postgresdbTest :5432/postgres"
11
+ DATABASE_URL : " postgresql://postgres:postgres@localhost :5432/postgres"
12
12
runs-on : ubuntu-latest
13
13
services :
14
14
postgresdbTest :
20
20
ports :
21
21
- 5432:5432
22
22
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
23
-
24
23
strategy :
25
24
max-parallel : 10
26
25
matrix :
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
- <coverage version =" 7.4.4" timestamp =" 1713058409019 " lines-valid =" 629" lines-covered =" 187" line-rate =" 0.2973" branches-covered =" 0" branches-valid =" 0" branch-rate =" 0" complexity =" 0" >
2
+ <coverage version =" 7.4.4" timestamp =" 1713061892639 " lines-valid =" 629" lines-covered =" 187" line-rate =" 0.2973" branches-covered =" 0" branches-valid =" 0" branch-rate =" 0" complexity =" 0" >
3
3
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.4.4 -->
4
4
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
5
5
<sources >
77
77
<line number =" 416" hits =" 1" />
78
78
<line number =" 426" hits =" 1" />
79
79
<line number =" 435" hits =" 1" />
80
- <line number =" 443 " hits =" 1" />
81
- <line number =" 474 " hits =" 1" />
82
- <line number =" 484 " hits =" 1" />
83
- <line number =" 493 " hits =" 1" />
84
- <line number =" 501 " hits =" 1" />
85
- <line number =" 532 " hits =" 1" />
86
- <line number =" 542 " hits =" 1" />
87
- <line number =" 551 " hits =" 1" />
80
+ <line number =" 444 " hits =" 1" />
81
+ <line number =" 475 " hits =" 1" />
82
+ <line number =" 485 " hits =" 1" />
83
+ <line number =" 494 " hits =" 1" />
84
+ <line number =" 503 " hits =" 1" />
85
+ <line number =" 534 " hits =" 1" />
86
+ <line number =" 544 " hits =" 1" />
87
+ <line number =" 553 " hits =" 1" />
88
88
</lines >
89
89
</class >
90
90
<class name =" database_config.py" filename =" dsg_lib/async_database_functions/database_config.py" complexity =" 0" line-rate =" 0.72" branch-rate =" 0" >
Original file line number Diff line number Diff line change 11
11
SchemaBaseSQLite ,
12
12
)
13
13
14
+ import os
15
+
16
+ # Get the database URL from the environment variable
17
+ database_url = os .getenv ('DATABASE_URL' , 'postgresql://postgres:postgres@postgresdbTest:5432/postgres' )
18
+
14
19
Base = declarative_base ()
15
20
16
21
# Define a dictionary with the connection strings for each database
17
22
# Replace the placeholders with your actual connection details
18
23
DATABASES = {
19
24
"sqlite" : "sqlite:///:memory:" ,
20
- "postgres" : "postgresql://postgres:postgres@postgresdbTest:5432/postgres" ,
21
- # postgresql+asyncpg://postgres:postgres@postgresdb:5432/devsetgo
25
+ "postgres" : database_url ,
22
26
}
23
27
24
28
# Define a dictionary with the schema base classes for each database
You can’t perform that action at this time.
0 commit comments