Skip to content

Commit

Permalink
release: v2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Jun 7, 2023
1 parent ccec7ea commit c4e602f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
Changes
=======

Version 2.1.5 (released 2023-06-06)

- fixtures: add alembic test fixture

Version 2.1.4 (released 2023-06-02)

- user fixture: use identity ID as int
Expand Down
2 changes: 1 addition & 1 deletion pytest_invenio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,6 @@ def test_browser(live_server, browser):
"""


__version__ = "2.1.4"
__version__ = "2.1.5"

__all__ = ("__version__",)
6 changes: 4 additions & 2 deletions pytest_invenio/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import tempfile
from datetime import datetime
from warnings import warn
from invenio_db.utils import drop_alembic_version_table

import importlib_metadata
import pkg_resources
import pytest
from invenio_db.utils import drop_alembic_version_table
from pytest_flask.plugin import _make_test_response_class
from selenium import webdriver

Expand Down Expand Up @@ -886,8 +886,10 @@ def test_alembic():
done per version, meaning that every time a new version is installed alembic has to run, therefore this test
implements that behaviour by upgrading per revision_id instead of upgrade from scratch to the latest.
"""

def _test_alembic(app, db, module_name, downgrade_target="base"):
"""Test alembic recipes for a concrete module."""

def _sort_revision_ids(scripts_list):
"""Sorts the scripts based on the previous and next revisions and returns a list of sorted revision ids."""
revision_ids = []
Expand Down Expand Up @@ -920,7 +922,7 @@ def _sort_revision_ids(scripts_list):
revision_ids = _sort_revision_ids(module_scripts)
for revision_id in revision_ids:
ext.alembic.upgrade(target=revision_id)

ext.alembic.upgrade() # Update all the rest of the branches to the latest heads
assert not ext.alembic.compare_metadata()
ext.alembic.downgrade(target=downgrade_target)
for revision_id in revision_ids:
Expand Down

0 comments on commit c4e602f

Please sign in to comment.