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

Create RuntimeConfig fixture #10242

Merged
merged 9 commits into from
May 31, 2024
20 changes: 11 additions & 9 deletions tests/unit/config/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import dbt.config
import dbt.exceptions
from dbt import tracking
from dbt.config.profile import Profile
from dbt.config.project import Project
from dbt.contracts.project import PackageConfig
from dbt.flags import set_from_args
from dbt.tests.util import safe_set_invocation_context
Expand All @@ -16,7 +18,15 @@
)


class TestRuntimeConfig(BaseConfigTest):
class TestRuntimeConfig:
def test_str(self, profile: Profile, project: Project) -> None:
config = dbt.config.RuntimeConfig.from_parts(project, profile, {})

# to make sure nothing terrible happens
str(config)


class TestRuntimeConfigOLD(BaseConfigTest):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class, TestRuntimeConfigOLD, goes away in a later commit (ce46f02) after we've moved all the tests it contains.

def get_project(self):
return project_from_config_norender(
self.default_project_data,
Expand Down Expand Up @@ -62,14 +72,6 @@ def test_from_parts(self):
}
self.assertEqual(config.to_project_config(), expected_project)

def test_str(self):
project = self.get_project()
profile = self.get_profile()
config = dbt.config.RuntimeConfig.from_parts(project, profile, {})

# to make sure nothing terrible happens
str(config)

def test_supported_version(self):
self.default_project_data["require-dbt-version"] = ">0.0.0"
conf = self.from_parts()
Expand Down