From 2d59088130cb985adfa88314918a62314e8fe173 Mon Sep 17 00:00:00 2001 From: case-k-git Date: Tue, 9 Jan 2024 20:55:39 +0900 Subject: [PATCH] update test schema handling --- tests/integration/base.py | 8 ++++++-- .../test_incremental_on_schema_change.py | 3 --- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/integration/base.py b/tests/integration/base.py index aa8bedaf2..dd58a305a 100644 --- a/tests/integration/base.py +++ b/tests/integration/base.py @@ -166,8 +166,11 @@ def packages_config(self): def selectors_config(self): return None - # pass profile setting schema and test passed schema. Should not be make lower case to test upper case + # To test schema related test lower or upper, we can chose if we want to use the default schema or the test define schema def unique_schema(self, schema=None): + if hasattr(self, 'schema'): + schema = self.schema + return "{}_{}".format(self.prefix, schema) if schema is None: return self.config.credentials.schema return "{}_{}".format(self.prefix, schema) @@ -193,7 +196,8 @@ def get_profile(self, adapter_type): "target": "dev", }, } - profile["test"]["outputs"]["dev"]["schema"] = self.unique_schema(schema = profile["test"]["outputs"]["dev"]["schema"]) + if 'schema' in profile["test"]["outputs"]["dev"]: + profile["test"]["outputs"]["dev"]["schema"] = self.unique_schema(schema = profile["test"]["outputs"]["dev"]["schema"]) return profile def _pick_profile(self): diff --git a/tests/integration/incremental_on_schema_change/test_incremental_on_schema_change.py b/tests/integration/incremental_on_schema_change/test_incremental_on_schema_change.py index b19e8e2db..f461aeba7 100644 --- a/tests/integration/incremental_on_schema_change/test_incremental_on_schema_change.py +++ b/tests/integration/incremental_on_schema_change/test_incremental_on_schema_change.py @@ -2,9 +2,6 @@ class TestIncrementalOnSchemaChange(DBTIntegrationTest): - @property - def schema(self): - return "incremental_on_schema_change" @property def models(self):