|
13 | 13 | import pytest |
14 | 14 |
|
15 | 15 | from pathlib import Path |
| 16 | +from dbt_common.exceptions.base import DbtRuntimeError |
16 | 17 |
|
17 | 18 | from tests.hooks.fixtures import ( |
18 | 19 | macros__hook, |
19 | 20 | macros__before_and_after, |
20 | 21 | models__hooks, |
21 | | - seeds__example_seed_csv, |
22 | | - macros_missing_column, |
23 | | - models__missing_column, |
| 22 | + seeds__example_seed_csv |
24 | 23 | ) |
25 | 24 |
|
26 | 25 | from dbt.tests.util import ( |
27 | 26 | check_table_does_not_exist, |
28 | 27 | run_dbt, |
29 | 28 | ) |
30 | 29 |
|
31 | | -from dbt.tests.adapter.hooks.test_run_hooks import TestAfterRunHooks |
| 30 | +from dbt.tests.adapter.hooks.test_run_hooks import BaseAfterRunHooks |
32 | 31 |
|
33 | 32 | from tests.utils.util import BUCKET, SOURCE |
34 | 33 |
|
@@ -195,11 +194,9 @@ def test_pre_and_post_seed_hooks(self, setUp, project, dbt_profile_target): |
195 | 194 | self.assert_used_schemas(project) |
196 | 195 |
|
197 | 196 |
|
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