2
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): 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 # works with "non-native" objects
from sqlalchemy.orm import Query
query = Query({}) query = Query({})
dist = self.app.get_distribution(query) dist = self.app.get_distribution(query)
self.assertEqual(dist, 'SQLAlchemy') self.assertEqual(dist, 'SQLAlchemy')
@ -192,8 +196,12 @@ class TestAppHandler(TestCase):
def test_get_version(self): def test_get_version(self):
from importlib.metadata import version 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 # works with "non-native" objects
from sqlalchemy.orm import Query
query = Query({}) query = Query({})
ver = self.app.get_version(obj=query) ver = self.app.get_version(obj=query)
self.assertEqual(ver, version('SQLAlchemy')) self.assertEqual(ver, version('SQLAlchemy'))