Skip to content

Commit 3f16685

Browse files
committed
Fix hooks tests
1 parent 8964af5 commit 3f16685

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

.github/expected_failures.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ tests/functional/adapter/dremio_specific/test_verify_ssl.py::TestVerifyCertifica
55
tests/hooks/test_model_hooks.py::TestPrePostModelHooksInConfigDremio::test_pre_and_post_model_hooks_model
66
tests/hooks/test_model_hooks.py::TestPrePostModelHooksInConfigWithCountDremio::test_pre_and_post_model_hooks_model_and_project
77
tests/hooks/test_model_hooks.py::TestPrePostModelHooksInConfigKwargsDremio::test_pre_and_post_model_hooks_model
8-
tests/hooks/test_run_hooks.py::TestPrePostRunHooksDremio::test_pre_and_post_run_hooks

tests/hooks/test_run_hooks.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,21 @@
1313
import pytest
1414

1515
from pathlib import Path
16+
from dbt_common.exceptions.base import DbtRuntimeError
1617

1718
from tests.hooks.fixtures import (
1819
macros__hook,
1920
macros__before_and_after,
2021
models__hooks,
21-
seeds__example_seed_csv,
22-
macros_missing_column,
23-
models__missing_column,
22+
seeds__example_seed_csv
2423
)
2524

2625
from dbt.tests.util import (
2726
check_table_does_not_exist,
2827
run_dbt,
2928
)
3029

31-
from dbt.tests.adapter.hooks.test_run_hooks import TestAfterRunHooks
30+
from dbt.tests.adapter.hooks.test_run_hooks import BaseAfterRunHooks
3231

3332
from tests.utils.util import BUCKET, SOURCE
3433

@@ -195,11 +194,9 @@ def test_pre_and_post_seed_hooks(self, setUp, project, dbt_profile_target):
195194
self.assert_used_schemas(project)
196195

197196

198-
class TestAfterRunHooksDremio(TestAfterRunHooks):
199-
@pytest.fixture(scope="class")
200-
def macros(self):
201-
return {"temp_macro.sql": macros_missing_column}
202-
203-
@pytest.fixture(scope="class")
204-
def models(self):
205-
return {"test_column.sql": models__missing_column}
197+
class TestAfterRunHooksDremio(BaseAfterRunHooks):
198+
def test_missing_column_pre_hook(self, project):
199+
# Changing DbtDatabaseError to DbtRuntimeError because our exception_handler
200+
# only raises DbtRuntimeError
201+
with pytest.raises(DbtRuntimeError):
202+
run_dbt(["run"], expect_pass=False)

0 commit comments

Comments
 (0)