Skip to content

Commit

Permalink
fixes side effects of tests modifying os.environ.
Browse files Browse the repository at this point in the history
  • Loading branch information
willi-mueller committed Sep 2, 2024
1 parent 1114c5f commit 336def8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/sources/sql_database/test_sql_database_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ def dispose_engines():
gc.collect()


@pytest.fixture(autouse=True)
def reset_os_environ():
# Save the current state of os.environ
original_environ = deepcopy(os.environ)
yield
# Restore the original state of os.environ
os.environ.clear()
os.environ.update(original_environ)

def make_pipeline(destination_name: str) -> dlt.Pipeline:
return dlt.pipeline(
pipeline_name="sql_database",
Expand Down Expand Up @@ -738,7 +747,6 @@ def test_sql_database_include_view_in_table_names(
assert_row_counts(pipeline, sql_source_db, ["app_user", "chat_message_view"])



@pytest.mark.parametrize("backend", ["pyarrow", "pandas", "sqlalchemy"])
@pytest.mark.parametrize("standalone_resource", [True, False])
@pytest.mark.parametrize("reflection_level", ["minimal", "full", "full_with_precision"])
Expand Down

0 comments on commit 336def8

Please sign in to comment.