Skip to content

Commit

Permalink
called_once_with -> assert_called_once_with
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Feb 23, 2024
1 parent 04c15ea commit 86f0841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions core/dbt/task/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

from dbt.task.base import BaseTask, move_to_nearest_project_dir

from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory
from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME

DOCS_URL = "https://docs.getdbt.com/docs/configure-your-profile"
SLACK_URL = "https://community.getdbt.com/"

Expand All @@ -54,9 +57,6 @@

class InitTask(BaseTask):
def copy_starter_repo(self, project_name: str) -> None:
# Lazy import to avoid ModuleNotFoundError
from dbt.include.starter_project import PACKAGE_PATH as starter_project_directory

fire_event(StarterProjectPath(dir=starter_project_directory))
shutil.copytree(
starter_project_directory, project_name, ignore=shutil.ignore_patterns(*IGNORE_FILES)
Expand Down Expand Up @@ -264,10 +264,6 @@ def setup_profile(self, profile_name: str) -> None:

def get_valid_project_name(self) -> str:
"""Returns a valid project name, either from CLI arg or user prompt."""

# Lazy import to avoid ModuleNotFoundError
from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME

name = self.args.project_name
internal_package_names = {GLOBAL_PROJECT_NAME}
available_adapters = list(_get_adapter_plugin_names())
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_get_nodes(self, tracking, get_nodes_plugins):
nodes = pm.get_nodes()

assert len(nodes.models) == 2
assert tracking.track_plugin_get_nodes.called_once_with(
tracking.track_plugin_get_nodes.assert_called_once_with(
{
"plugin_name": get_nodes_plugins[0].name,
"num_model_nodes": 2,
Expand Down

0 comments on commit 86f0841

Please sign in to comment.