Skip to content

Commit

Permalink
Add one hooks test
Browse files Browse the repository at this point in the history
  • Loading branch information
genzgd committed Nov 23, 2023
1 parent f3c22b2 commit 3dc990e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/integration/adapter/hooks/test_model_hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pytest
from dbt.exceptions import CompilationError

from dbt.tests.adapter.hooks.fixtures import models__hooks_error
from dbt.tests.util import run_dbt


class TestDuplicateHooksInConfigs:
@pytest.fixture(scope="class")
def models(self):
return {"hooks.sql": models__hooks_error}

def test_run_duplicate_hook_defs(self, project):
with pytest.raises(CompilationError) as exc:
run_dbt()
assert "pre_hook" in str(exc.value)
assert "pre-hook" in str(exc.value)

0 comments on commit 3dc990e

Please sign in to comment.