diff --git a/tests/test_app.py b/tests/test_app.py index 3c8aa9c..8525a26 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -119,8 +119,12 @@ class TestAppHandler(TestCase): def test_get_distribution(self): + try: + from sqlalchemy.orm import Query + except ImportError: + pytest.skip("test is not relevant without sqlalchemy") + # works with "non-native" objects - from sqlalchemy.orm import Query query = Query({}) dist = self.app.get_distribution(query) self.assertEqual(dist, 'SQLAlchemy') @@ -192,8 +196,12 @@ class TestAppHandler(TestCase): def test_get_version(self): from importlib.metadata import version + try: + from sqlalchemy.orm import Query + except ImportError: + pytest.skip("test is not relevant without sqlalchemy") + # works with "non-native" objects - from sqlalchemy.orm import Query query = Query({}) ver = self.app.get_version(obj=query) self.assertEqual(ver, version('SQLAlchemy'))