Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/tests/conftest.py
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
@pytest.fixture | @pytest.fixture | ||||
def archive_api(swh_storage_with_objects): | def archive_api(swh_storage_with_objects): | ||||
return ArchiveStorage(swh_storage_with_objects) | return ArchiveStorage(swh_storage_with_objects) | ||||
@pytest.fixture | @pytest.fixture | ||||
def archive_pg(swh_storage_with_objects): | def archive(swh_storage_with_objects): | ||||
"""Return a ArchivePostgreSQL based StorageInterface object""" | |||||
# this is a workaround to prevent tests from hanging because of an unclosed | # this is a workaround to prevent tests from hanging because of an unclosed | ||||
# transaction. | # transaction. | ||||
# TODO: refactor the ArchivePostgreSQL to properly deal with | # TODO: refactor the ArchivePostgreSQL to properly deal with | ||||
# transactions and get rif of this fixture | # transactions and get rif of this fixture | ||||
archive = ArchivePostgreSQL(conn=swh_storage_with_objects.get_db().conn) | archive = ArchivePostgreSQL(conn=swh_storage_with_objects.get_db().conn) | ||||
yield archive | yield archive | ||||
archive.conn.rollback() | archive.conn.rollback() | ||||
▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines |