Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8393716
conftest.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
796 B
Subscribers
None
conftest.py
View Options
# Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
pytest
from
pytest_postgresql.janitor
import
DatabaseJanitor
from
sqlalchemy
import
create_engine
@pytest.fixture
def
sqlalchemy_engine
(
postgresql_proc
):
pg_host
=
postgresql_proc
.
host
pg_port
=
postgresql_proc
.
port
pg_user
=
postgresql_proc
.
user
pg_db
=
'sqlalchemy-tests'
url
=
f
'postgresql://{pg_user}@{pg_host}:{pg_port}/{pg_db}'
with
DatabaseJanitor
(
pg_user
,
pg_host
,
pg_port
,
pg_db
,
postgresql_proc
.
version
):
engine
=
create_engine
(
url
)
yield
engine
engine
.
dispose
()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Wed, Jun 4, 7:16 PM (5 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3340665
Attached To
rDSTOC swh-storage-cassandra
Event Timeline
Log In to Comment