Skip to content

Commit

Permalink
fix: dict patch
Browse files Browse the repository at this point in the history
  • Loading branch information
reata committed Apr 7, 2024
1 parent 5ba5cf7 commit 54114c9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
node-version: '16'
- name: Install
run: pip install tox codecov
- name: Echo home
run:
python -c "import os; print(os.path.expanduser('~')); print(os.environ.get('USERPROFILE')); print(os.environ.get('HOMEPATH')); print(os.environ.get('HOMEDRIVE')); print(os.environ.get('HOME'))"
- name: Script
run: tox -e py
- name: After Success
Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from sqllineage.runner import LineageRunner


@patch(
"os.environ",
@patch.dict(
os.environ,
{
"SQLLINEAGE_DIRECTORY": os.path.join(os.path.dirname(__file__), "data"),
"SQLLINEAGE_DEFAULT_SCHEMA": "<default>",
Expand Down
3 changes: 2 additions & 1 deletion tests/core/test_exception.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from unittest.mock import patch

import pytest
Expand Down Expand Up @@ -56,7 +57,7 @@ def test_syntax_warning_no_semicolon_in_tsql():
)._eval()


@patch("os.environ", {"SQLLINEAGE_TSQL_NO_SEMICOLON": "TRUE"})
@patch.dict(os.environ, {"SQLLINEAGE_TSQL_NO_SEMICOLON": "TRUE"})
def test_user_warning_enable_tsql_no_semicolon_with_other_dialect():
with pytest.warns(UserWarning):
LineageRunner(
Expand Down
11 changes: 6 additions & 5 deletions tests/sql/column/test_column_select_lateral_alias_ref.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from unittest.mock import patch

import pytest
Expand All @@ -14,7 +15,7 @@


@pytest.mark.parametrize("provider", providers)
@patch("os.environ", {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
@patch.dict(os.environ, {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
def test_column_top_level_enable_lateral_ref(
provider: MetaDataProvider,
):
Expand Down Expand Up @@ -106,7 +107,7 @@ def test_column_top_level_enable_lateral_ref(


@pytest.mark.parametrize("provider", providers)
@patch("os.environ", {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
@patch.dict(os.environ, {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
def test_column_top_level_enable_lateral_ref_with_metadata_from_table(
provider: MetaDataProvider,
):
Expand Down Expand Up @@ -148,7 +149,7 @@ def test_column_top_level_enable_lateral_ref_with_metadata_from_table(


@pytest.mark.parametrize("provider", providers)
@patch("os.environ", {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
@patch.dict(os.environ, {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
def test_column_top_level_enable_lateral_ref_with_metadata_from_subquery(
provider: MetaDataProvider,
):
Expand Down Expand Up @@ -195,7 +196,7 @@ def test_column_top_level_enable_lateral_ref_with_metadata_from_subquery(


@pytest.mark.parametrize("provider", providers)
@patch("os.environ", {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
@patch.dict(os.environ, {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
def test_column_top_level_enable_lateral_ref_with_metadata_from_nested_subquery(
provider: MetaDataProvider,
):
Expand Down Expand Up @@ -247,7 +248,7 @@ def test_column_top_level_enable_lateral_ref_with_metadata_from_nested_subquery(


@pytest.mark.parametrize("provider", providers)
@patch("os.environ", {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
@patch.dict(os.environ, {"SQLLINEAGE_LATERAL_COLUMN_ALIAS_REFERENCE": "1"})
def test_column_enable_lateral_ref_within_subquery(
provider: MetaDataProvider,
):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
from unittest.mock import patch

import pytest

from ....helpers import assert_table_lineage_equal


@patch("os.environ", {"SQLLINEAGE_TSQL_NO_SEMICOLON": "TRUE"})
@patch.dict(os.environ, {"SQLLINEAGE_TSQL_NO_SEMICOLON": "TRUE"})
@pytest.mark.parametrize("dialect", ["tsql"])
def test_tsql_multi_statement_no_semicolon(dialect: str):
"""
Expand Down

0 comments on commit 54114c9

Please sign in to comment.