diff --git a/CHANGELOG.md b/CHANGELOG.md index 377673d3..8b9953b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Add missing brew path to GitHub action. It has been removed from PATH variable in Ubuntu - Badges on README page +- Unfreeze SQLAlchemy again, allowing >=1.3 as the limitation in chanjo-report is being fixed ## [4.6.1] - 2021-07-08 ### Fixed diff --git a/chanjo/init/bootstrap.py b/chanjo/init/bootstrap.py index 362c17f9..3c84c35a 100644 --- a/chanjo/init/bootstrap.py +++ b/chanjo/init/bootstrap.py @@ -42,4 +42,4 @@ def pull(target_dir, force=False): # pragma: no cover logger.info('removing BED archive...') bed_zip_path.remove_p() else: - logger.warn('file already exists, skipping: %s', final_bed) + logger.warning('file already exists, skipping: %s', final_bed) diff --git a/chanjo/init/demo.py b/chanjo/init/demo.py index 166ce781..ae138893 100644 --- a/chanjo/init/demo.py +++ b/chanjo/init/demo.py @@ -30,7 +30,7 @@ def setup_demo(location, force=False): # we can copy the directory(tree) demo_dir.copytree(target_dir) except OSError as error: - log.warn('location must be a non-existing directory') + log.warning('location must be a non-existing directory') raise error # inform the user diff --git a/requirements.txt b/requirements.txt index 189e6525..fd6b3fe3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ toolz pyyaml importlib_metadata pymysql -sqlalchemy==1.3.* +sqlalchemy<2.0 diff --git a/tests/conftest.py b/tests/conftest.py index 5282ef12..ea050e50 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,7 +13,7 @@ from chanjo.load.link import link_elements -@pytest.yield_fixture +@pytest.fixture def reset_path(): """Reset PATH environment variable temporarily.""" path_env = os.environ['PATH'] @@ -22,7 +22,7 @@ def reset_path(): os.environ['PATH'] = path_env -@pytest.yield_fixture(scope='function') +@pytest.fixture(scope='function') def chanjo_db(): _chanjo_db = ChanjoDB('sqlite://') _chanjo_db.set_up() @@ -30,7 +30,7 @@ def chanjo_db(): _chanjo_db.tear_down() -@pytest.yield_fixture(scope='function') +@pytest.fixture(scope='function') def existing_db(tmpdir): db_path = tmpdir.join('coverage.sqlite3') chanjo_db = ChanjoDB(str(db_path)) @@ -39,7 +39,7 @@ def existing_db(tmpdir): chanjo_db.tear_down() -@pytest.yield_fixture(scope='function') +@pytest.fixture(scope='function') def popexist_db(existing_db, exon_lines): result = link_elements(exon_lines) existing_db.add(*result.models) @@ -50,7 +50,7 @@ def popexist_db(existing_db, exon_lines): yield existing_db -@pytest.yield_fixture(scope='function') +@pytest.fixture(scope='function') def populated_db(chanjo_db, exon_lines): exon_lines = list(exon_lines) result = link_elements(exon_lines) diff --git a/tests/store/test_store_api.py b/tests/store/test_store_api.py index 19ac15ac..39448d94 100644 --- a/tests/store/test_store_api.py +++ b/tests/store/test_store_api.py @@ -4,7 +4,7 @@ from datetime import datetime import pytest -from sqlalchemy.orm.exc import FlushError +from sqlalchemy.exc import IntegrityError from chanjo.store.api import ChanjoDB from chanjo.store.models import Sample @@ -38,8 +38,8 @@ def test_save(chanjo_db): # GIVEN sample already exists conflict_sample = Sample(id=sample_id, group_id="ADMG2") # WHEN saving it again with same id - # THEN error is raised _after_ rollback - with pytest.raises(FlushError): + # THEN an error is raised + with pytest.raises(IntegrityError): chanjo_db.add(conflict_sample) chanjo_db.save()