Changeset View
Changeset View
Standalone View
Standalone View
swh/core/db/tests/test_db.py
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | |||||
def convert_lines(cur): | def convert_lines(cur): | ||||
return [ | return [ | ||||
tuple(field.out_converter(x) for x, field in zip(line, FIELDS)) for line in cur | tuple(field.out_converter(x) for x, field in zip(line, FIELDS)) for line in cur | ||||
] | ] | ||||
test_db = postgresql_fact("postgresql_proc", db_name="test-db2") | test_db = postgresql_fact("postgresql_proc", dbname="test-db2") | ||||
@pytest.fixture | @pytest.fixture | ||||
def db_with_data(test_db, request): | def db_with_data(test_db, request): | ||||
"""Fixture to initialize a db with some data out of the "INIT_SQL above | """Fixture to initialize a db with some data out of the "INIT_SQL above | ||||
""" | """ | ||||
db = BaseDb.connect(test_db.dsn) | db = BaseDb.connect(test_db.dsn) | ||||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |