Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Mar 8, 2023
1 parent bb0e462 commit 6ab9375
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# install latest changes in dbt-core
# TODO: how to automate switching from develop to version branches?
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-core.git@er/ct-2167-model-contracts-mats#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git@er/ct-2167-model-contracts-mats#egg=dbt-tests-adapter&subdirectory=tests/adapter

# if version 1.x or greater -> pin to major version
# if version 0.x -> pin to minor
Expand Down
28 changes: 5 additions & 23 deletions tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""


class TestSnowflakeTableConstraintsColumnsEqual(BaseTableConstraintsColumnsEqual):
class SnowflakeSetup:
@pytest.fixture
def int_type(self):
return "FIXED"
Expand All @@ -46,30 +46,12 @@ def data_types(self, int_type, schema_int_type, string_type):
["""TO_VARIANT(PARSE_JSON('{"key3": "value3", "key4": "value4"}'))""", 'variant', 'VARIANT'],
]

class TestSnowflakeTableConstraintsColumnsEqual(SnowflakeSetup, BaseTableConstraintsColumnsEqual):
pass

class TestSnowflakeViewConstraintsColumnsEqual(BaseViewConstraintsColumnsEqual):
@pytest.fixture
def int_type(self):
return "FIXED"

@pytest.fixture
def schema_int_type(self):
return "INT"

@pytest.fixture
def data_types(self, int_type, schema_int_type, string_type):
# sql_column_value, schema_data_type, error_data_type
return [
['1', schema_int_type, int_type],
["'1'", string_type, string_type],
["cast('2019-01-01' as date)", 'date', 'DATE'],
["true", 'boolean', 'BOOLEAN'],
["'2013-11-03 00:00:00-07'::timestamptz", 'timestamp_tz', 'TIMESTAMP_TZ'],
["'2013-11-03 00:00:00-07'::timestamp", 'timestamp', 'TIMESTAMP_NTZ'],
["ARRAY_CONSTRUCT('a','b','c')", 'array', 'ARRAY'],
["ARRAY_CONSTRUCT(1,2,3)", 'array', 'ARRAY'],
["""TO_VARIANT(PARSE_JSON('{"key3": "value3", "key4": "value4"}'))""", 'variant', 'VARIANT'],
]
class TestSnowflakeViewConstraintsColumnsEqual(SnowflakeSetup, BaseViewConstraintsColumnsEqual):
pass


class TestSnowflakeConstraintsRuntimeEnforcement(BaseConstraintsRuntimeEnforcement):
Expand Down

0 comments on commit 6ab9375

Please sign in to comment.