Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swap back to __version__.py #3

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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):
colin-rogers-dbt marked this conversation as resolved.
Show resolved Hide resolved
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
Loading