-
Notifications
You must be signed in to change notification settings - Fork 378
Expand file tree
/
Copy pathtest_docs.py
More file actions
28 lines (22 loc) · 846 Bytes
/
test_docs.py
File metadata and controls
28 lines (22 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from pathlib import Path
import pytest
from sqlmesh.core.config.model import ModelDefaultsConfig
from sqlmesh.dbt.context import DbtContext
from sqlmesh.dbt.manifest import ManifestHelper
from sqlmesh.dbt.profile import Profile
pytestmark = pytest.mark.dbt
@pytest.mark.xdist_group("dbt_manifest")
def test_docs_inline():
project_path = Path("tests/fixtures/dbt/sushi_test")
profile = Profile.load(DbtContext(project_path))
helper = ManifestHelper(
project_path,
project_path,
"sushi",
profile.target,
model_defaults=ModelDefaultsConfig(start="2020-01-01"),
)
# Inline description in yaml
assert helper.models()["waiters"].description == "waiters docs block"
# Docs block from .md file
assert helper.models()["top_waiters"].description == "description of top waiters"