Skip to content

Commit

Permalink
Moved importorskip() for psycopg in the correct place(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Aug 2, 2024
1 parent cb1a9b8 commit 383f434
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ async def psycopg_async_store() -> AsyncGenerator[DataStore, None]:

from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore

pytest.importorskip("psycopg", reason="psycopg not available")
engine = create_async_engine(
"postgresql+psycopg://postgres:secret@localhost/testdb"
)
Expand All @@ -177,6 +178,7 @@ def psycopg_sync_store() -> Generator[DataStore, None, None]:

from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore

pytest.importorskip("psycopg", reason="psycopg not available")
engine = create_engine("postgresql+psycopg://postgres:secret@localhost/testdb")
try:
with engine.begin() as conn:
Expand Down
1 change: 0 additions & 1 deletion tests/test_datastores.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,6 @@ async def test_aiosqlite(
)

async def test_psycopg(self, psycopg_async_store: SQLAlchemyDataStore) -> None:
pytest.importorskip("psycopg")
assert repr(psycopg_async_store) == (
"SQLAlchemyDataStore(url='postgresql+psycopg://postgres:***@localhost/"
"testdb', schema='psycopg_async')"
Expand Down

0 comments on commit 383f434

Please sign in to comment.