Skip to content

Commit

Permalink
only import sqlalchemy in tests if present
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Sep 4, 2024
1 parent be0a6c7 commit 2b1578b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/load/sources/sql_database/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from typing import Iterator
from typing import Iterator, Any

import pytest

import dlt
from dlt.sources.credentials import ConnectionStringCredentials
from tests.load.sources.sql_database.sql_source import SQLAlchemySourceDB

try:
from tests.load.sources.sql_database.sql_source import SQLAlchemySourceDB
except ModuleNotFoundError:
SQLAlchemySourceDB = Any
pytest.skip("test needs sql_alchemy")


def _create_db(**kwargs) -> Iterator[SQLAlchemySourceDB]:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest


# TODO: not all template functions are tested here
# we may be able to test more in tests/load/sources
@pytest.mark.parametrize(
Expand Down

0 comments on commit 2b1578b

Please sign in to comment.