Skip to content

Commit

Permalink
use shared empty flag tests (#1104)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare authored Jul 3, 2024
1 parent ce596f2 commit 8ae3ec8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 113 deletions.
72 changes: 0 additions & 72 deletions tests/functional/adapter/empty/_models.py

This file was deleted.

48 changes: 7 additions & 41 deletions tests/functional/adapter/empty/test_empty.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from dbt.tests.adapter.empty.test_empty import BaseTestEmpty, BaseTestEmptyInlineSourceRef
from dbt.tests.util import run_dbt
import pytest

from tests.functional.adapter.empty import _models
from dbt.tests.adapter.empty.test_empty import (
BaseTestEmpty,
BaseTestEmptyInlineSourceRef,
MetadataWithEmptyFlag,
)


class TestSnowflakeEmpty(BaseTestEmpty):
Expand All @@ -13,39 +13,5 @@ class TestSnowflakeEmptyInlineSourceRef(BaseTestEmptyInlineSourceRef):
pass


class TestMetadataWithEmptyFlag:
@pytest.fixture(scope="class")
def seeds(self):
return {"my_seed.csv": _models.SEED}

@pytest.fixture(scope="class")
def models(self):
return {
"schema.yml": _models.SCHEMA,
"control.sql": _models.CONTROL,
"get_columns_in_relation.sql": _models.GET_COLUMNS_IN_RELATION,
"alter_column_type.sql": _models.ALTER_COLUMN_TYPE,
"alter_relation_comment.sql": _models.ALTER_RELATION_COMMENT,
"alter_column_comment.sql": _models.ALTER_COLUMN_COMMENT,
"alter_relation_add_remove_columns.sql": _models.ALTER_RELATION_ADD_REMOVE_COLUMNS,
"truncate_relation.sql": _models.TRUNCATE_RELATION,
}

@pytest.fixture(scope="class", autouse=True)
def setup(self, project):
run_dbt(["seed"])

@pytest.mark.parametrize(
"model",
[
"control",
"get_columns_in_relation",
"alter_column_type",
"alter_relation_comment",
"alter_column_comment",
"alter_relation_add_remove_columns",
"truncate_relation",
],
)
def test_run(self, project, model):
run_dbt(["run", "--empty", "--select", model])
class TestMetadataWithEmptyFlag(MetadataWithEmptyFlag):
pass

0 comments on commit 8ae3ec8

Please sign in to comment.