Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
336eeea3
Commit
336eeea3
authored
5 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix postgres unit tests to use prepare_database
parent
bb6264be
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/utils.py
+2
-10
2 additions, 10 deletions
tests/utils.py
with
2 additions
and
10 deletions
tests/utils.py
+
2
−
10
View file @
336eeea3
...
...
@@ -38,11 +38,7 @@ from synapse.logging.context import LoggingContext
from
synapse.server
import
HomeServer
from
synapse.storage
import
DataStore
from
synapse.storage.engines
import
PostgresEngine
,
create_engine
from
synapse.storage.prepare_database
import
(
_get_or_create_schema_state
,
_setup_new_database
,
prepare_database
,
)
from
synapse.storage.prepare_database
import
prepare_database
from
synapse.util.ratelimitutils
import
FederationRateLimiter
# set this to True to run the tests against postgres instead of sqlite.
...
...
@@ -88,11 +84,7 @@ def setupdb():
host
=
POSTGRES_HOST
,
password
=
POSTGRES_PASSWORD
,
)
cur
=
db_conn
.
cursor
()
_get_or_create_schema_state
(
cur
,
db_engine
)
_setup_new_database
(
cur
,
db_engine
)
db_conn
.
commit
()
cur
.
close
()
prepare_database
(
db_conn
,
db_engine
,
None
)
db_conn
.
close
()
def
_cleanup
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment