Skip to content

Commit

Permalink
Skip obscore test when pg_sphere is missing (DM-37939)
Browse files Browse the repository at this point in the history
The fix only changes type of the exception checked when pg_sphere
extension is installed. The logic which skips the test is already there.
  • Loading branch information
andy-slac committed Feb 9, 2023
1 parent f0318b2 commit 4a70600
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_obscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ def _handler(cls, postgresql):
engine = sqlalchemy.engine.create_engine(postgresql.url())
with engine.begin() as connection:
try:
connection.execute(sqlalchemy.text("CREATE EXTENSION pg_sphere;"))
except sqlalchemy.exc.OperationalError:
raise unittest.SkipTest("pg_sphere extension does not exist")
connection.execute(sqlalchemy.text("CREATE EXTENSION pg_sphere"))
except sqlalchemy.exc.DatabaseError as exc:
raise unittest.SkipTest(f"pg_sphere extension does not exist: {exc}")

def make_obscore_config(
self, collections: Optional[List[str]] = None, collection_type: Optional[str] = None
Expand Down

0 comments on commit 4a70600

Please sign in to comment.