Skip to content

Commit

Permalink
swap back to __version__.py (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-rogers-dbt authored Feb 1, 2024
1 parent 317f1e9 commit 6bf58e8
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 524 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ will be reflected in the virtual environment immediately.
`dbt-postgres` contains [unit](https://github.com/dbt-labs/dbt-postgres/tree/main/tests/unit)
and [functional](https://github.com/dbt-labs/dbt-postgres/tree/main/tests/functional) tests.


### Unit tests

Unit tests can be run locally without setting up a database connection:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ include = ["dbt"]
packages = ["dbt"]

[tool.hatch.version]
path = "dbt/adapters/postgres/__about__.py"
path = "dbt/adapters/postgres/__version__.py"

[tool.hatch.envs.default]
features = [
Expand Down
55 changes: 55 additions & 0 deletions tests/functional/dbt_debug/test_dbt_debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import pytest
import os
import re
import yaml

from tests.functional.utils import run_dbt, run_dbt_and_capture

MODELS__MODEL_SQL = """
seled 1 as id
"""


class BaseDebug:
@pytest.fixture(scope="class")
def models(self):
return {"model.sql": MODELS__MODEL_SQL}

@pytest.fixture(autouse=True)
def capsys(self, capsys):
self.capsys = capsys

def assertGotValue(self, linepat, result):
found = False
output = self.capsys.readouterr().out
for line in output.split("\n"):
if linepat.match(line):
found = True
assert result in line
if not found:
with pytest.raises(Exception) as exc:
msg = f"linepat {linepat} not found in stdout: {output}"
assert msg in str(exc.value)

def check_project(self, splitout, msg="ERROR invalid"):
for line in splitout:
if line.strip().startswith("dbt_project.yml file"):
assert msg in line
elif line.strip().startswith("profiles.yml file"):
assert "ERROR invalid" not in line


class BaseDebugProfileVariable(BaseDebug):
@pytest.fixture(scope="class")
def project_config_update(self):
return {"config-version": 2, "profile": '{{ "te" ~ "st" }}'}


class TestDebugPostgres(BaseDebug):
def test_ok(self, project):
result, log = run_dbt_and_capture(["debug"])
assert "ERROR" not in log


class TestDebugProfileVariablePostgres(BaseDebugProfileVariable):
pass
34 changes: 0 additions & 34 deletions tests/functional/docs/test_duplicate_docs_block.py

This file was deleted.

100 changes: 0 additions & 100 deletions tests/functional/docs/test_generate.py

This file was deleted.

177 changes: 0 additions & 177 deletions tests/functional/docs/test_good_docs_blocks.py

This file was deleted.

Loading

0 comments on commit 6bf58e8

Please sign in to comment.