Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLAlchemy: SQLServer test #143

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/test_sqlalchemy_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
# The following dialects are skipped by default, tested if value is set to 'True'
test_oracle = os.getenv("TEST_ORACLE", "False") == "True"
test_postgres = os.getenv("TEST_POSTGRES", "False") == "True"
test_sqlserver = os.getenv("TEST_SQLSERVER", "False") == "True"


# Create engines
Expand All @@ -57,6 +58,11 @@ def create_sqlachemy_engine(dialect):
engine = create_engine(
f"postgresql://postgres:{password}@localhost:5432/postgres"
)
elif dialect == "sqlserver":
engine = create_engine(
f"mssql+pyodbc://{user}:{password}@127.0.0.1:1433/ \
test_mojap_metadata?driver=ODBC+Driver+17+for+SQL+Server"
)
return engine


Expand Down Expand Up @@ -195,6 +201,19 @@ def expected_metadata(
"int32",
marks=(pytest.mark.skipif(test_oracle is False, reason="skip oracle test")),
),
pytest.param(
"sqlserver",
"dbo",
"this is my table",
"this is the comment",
["my_string_10"],
"bool",
marks=(
pytest.mark.skipif(
test_sqlserver is False, reason="skip sqlserver test"
)
),
),
],
)
def test_generate_to_meta(
Expand Down
Loading