Skip to content

Commit

Permalink
more test refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Nov 13, 2023
1 parent 82a37f6 commit 413e3bd
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_adapter_methods.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dbt.tests.adapter.basic.test_adapter_methods import BaseAdapterMethod


class TestDatabricksAdapterMethod(BaseAdapterMethod):
class TestAdapterMethod(BaseAdapterMethod):
"""Currently this exercises:
* get_columns_in_relation
* get_relation
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_base import BaseSimpleMaterializations


class TestDatabricksSimpleMaterializations(BaseSimpleMaterializations):
class TestSimpleMaterializations(BaseSimpleMaterializations):
pass
4 changes: 2 additions & 2 deletions tests/functional/adapter/basic/test_docs_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tests.functional.adapter.basic.typing import AnyLongType, StatsLikeDict


class TestDatabricksDocsGenerate(BaseDocsGenerate):
class TestDocsGenerate(BaseDocsGenerate):
@pytest.fixture(scope="class")
def expected_catalog(self, project):
return expected_catalog.base_expected_catalog(
Expand All @@ -22,7 +22,7 @@ def expected_catalog(self, project):
)


class TestDatabricksDocsGenReferences(BaseDocsGenReferences):
class TestDocsGenReferences(BaseDocsGenReferences):
@pytest.fixture(scope="class")
def expected_catalog(self, project):
return self.expected_references_catalog(
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_empty.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_empty import BaseEmpty


class TestDatabricksEmpty(BaseEmpty):
class TestEmpty(BaseEmpty):
pass
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_ephemeral.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_ephemeral import BaseEphemeral


class TestDatabricksEphemeral(BaseEphemeral):
class TestEphemeral(BaseEphemeral):
pass
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_generic_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_generic_tests import BaseGenericTests


class TestDatabricksGenericTests(BaseGenericTests):
class TestGenericTests(BaseGenericTests):
pass
4 changes: 2 additions & 2 deletions tests/functional/adapter/basic/test_incremental.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dbt.tests.adapter.basic.test_incremental import BaseIncremental, BaseIncrementalNotSchemaChange


class TestDatabricksIncremental(BaseIncremental):
class TestIncremental(BaseIncremental):
pass


class TestDatabricksIncrementalNotSchemaChange(BaseIncrementalNotSchemaChange):
class TestIncrementalNotSchemaChange(BaseIncrementalNotSchemaChange):
pass
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_singular_tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_singular_tests import BaseSingularTests


class TestDatabricksSingularTests(BaseSingularTests):
class TestSingularTests(BaseSingularTests):
pass
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_singular_tests_ephemeral import BaseSingularTestsEphemeral


class TestDatabricksSingularTestsEphemeral(BaseSingularTestsEphemeral):
class TestSingularTestsEphemeral(BaseSingularTestsEphemeral):
pass
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_snapshot_check_cols.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_snapshot_check_cols import BaseSnapshotCheckCols


class TestDatabricksSnapshotCheckCols(BaseSnapshotCheckCols):
class TestSnapshotCheckCols(BaseSnapshotCheckCols):
pass
2 changes: 1 addition & 1 deletion tests/functional/adapter/basic/test_snapshot_timestamp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp


class TestDatabricksSnapshotTimestamp(BaseSnapshotTimestamp):
class TestSnapshotTimestamp(BaseSnapshotTimestamp):
pass
5 changes: 5 additions & 0 deletions tests/functional/adapter/basic/test_table_materialization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.basic.test_table_materialization import BaseTableMaterialization


class TestTableMat(BaseTableMaterialization):
pass
5 changes: 5 additions & 0 deletions tests/functional/adapter/basic/test_validate_connection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.basic.test_validate_connection import BaseValidateConnection


class TestValidateConnection(BaseValidateConnection):
pass
35 changes: 35 additions & 0 deletions tests/functional/adapter/caching/test_caching.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from dbt.tests.adapter.caching.test_caching import (
BaseCachingTest,
BaseCachingLowercaseModel,
BaseCachingUppercaseModel,
BaseCachingSelectedSchemaOnly,
model_sql,
)

import pytest


class TestNoPopulateCache(BaseCachingTest):
@pytest.fixture(scope="class")
def models(self):
return {
"model.sql": model_sql,
}

def test_cache(self, project):
# --no-populate-cache still allows the cache to populate all relations
# under a schema, so the behavior here remains the same as other tests
run_args = ["--no-populate-cache", "run"]
self.run_and_inspect_cache(project, run_args)


class TestCachingLowerCaseModel(BaseCachingLowercaseModel):
pass


class TestCachingUppercaseModel(BaseCachingUppercaseModel):
pass


class TestCachingSelectedSchemaOnly(BaseCachingSelectedSchemaOnly):
pass

0 comments on commit 413e3bd

Please sign in to comment.