1
0
Fork 0

test: skip some tests for nodb scenario

This commit is contained in:
Lance Edgar 2024-08-05 22:41:58 -05:00
parent b5884ff6ca
commit 8068c26327

View file

@ -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'))