Skip to content

Commit

Permalink
Revert "Adap 821/unit test infer wrong datatype (#852)"
Browse files Browse the repository at this point in the history
This reverts commit b510298.
  • Loading branch information
VersusFacit authored Jul 17, 2024
1 parent b510298 commit db5100b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 133 deletions.
7 changes: 0 additions & 7 deletions .changes/unreleased/Fixes-20240625-170324.yaml

This file was deleted.

73 changes: 0 additions & 73 deletions tests/functional/adapter/unit_testing/fixtures.py

This file was deleted.

53 changes: 0 additions & 53 deletions tests/functional/adapter/unit_testing/test_unit_testing.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import pytest

from dbt.exceptions import ParsingError
from dbt.tests.fixtures.project import write_project_files
from dbt.tests.util import run_dbt

from dbt.tests.adapter.unit_testing.test_types import BaseUnitTestingTypes
from dbt.tests.adapter.unit_testing.test_case_insensitivity import BaseUnitTestCaseInsensivity
from dbt.tests.adapter.unit_testing.test_invalid_input import BaseUnitTestInvalidInput
from tests.functional.adapter.unit_testing.fixtures import (
model_none_value_base,
model_none_value_model,
test_none_column_value_doesnt_throw_error_csv,
test_none_column_value_doesnt_throw_error_dct,
test_none_column_value_will_throw_error,
)


class TestRedshiftUnitTestingTypes(BaseUnitTestingTypes):
Expand Down Expand Up @@ -46,47 +34,6 @@ def data_types(self):
]


class RedshiftUnitTestingNone:
def test_nones_handled_dict(self, project):
run_dbt(["build"])


class TestRedshiftUnitTestCsvNone(RedshiftUnitTestingNone):
@pytest.fixture(scope="class")
def models(self):
return {
"none_value_base.sql": model_none_value_base,
"none_value_model.sql": model_none_value_model,
"__properties.yml": test_none_column_value_doesnt_throw_error_csv,
}


class TestRedshiftUnitTestDictNone(RedshiftUnitTestingNone):
@pytest.fixture(scope="class")
def models(self):
return {
"none_value_base.sql": model_none_value_base,
"none_value_model.sql": model_none_value_model,
"__properties.yml": test_none_column_value_doesnt_throw_error_dct,
}


class TestRedshiftUnitTestingTooManyNonesFails:
@pytest.fixture(scope="class")
def models(self):
return {
"__properties.yml": test_none_column_value_will_throw_error,
"none_value_base.sql": model_none_value_base,
"none_value_model.sql": model_none_value_model,
}

def test_invalid_input(self, project):
with pytest.raises(ParsingError) as e:
run_dbt(["build"])

assert "Unit Test fixtures require at least one row free of None" in str(e)


class TestRedshiftUnitTestCaseInsensitivity(BaseUnitTestCaseInsensivity):
pass

Expand Down

0 comments on commit db5100b

Please sign in to comment.