-
Notifications
You must be signed in to change notification settings - Fork 96
Fix missing arguments to WorkflowLinter
#2809
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
Changes from all commits
1599803
3a17a56
ac2fefe
f334cfa
b3590b5
a76d7fe
8f9e000
767b072
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from unittest.mock import create_autospec | ||
|
||
import pytest | ||
from databricks.labs.lsql.backends import MockBackend | ||
|
||
from databricks.labs.ucx.contexts.application import GlobalContext | ||
from databricks.labs.ucx.contexts.workspace_cli import LocalCheckoutContext | ||
|
@@ -11,18 +12,28 @@ | |
|
||
|
||
@pytest.mark.parametrize( | ||
"attribute", ["dependency_resolver", "pip_resolver", "site_packages_path", "notebook_loader", "folder_loader"] | ||
"attribute", | ||
[ | ||
"dependency_resolver", | ||
"pip_resolver", | ||
"site_packages_path", | ||
"notebook_loader", | ||
"folder_loader", | ||
"workflow_linter", | ||
"used_tables_crawler_for_paths", | ||
"used_tables_crawler_for_queries", | ||
], | ||
) | ||
def test_global_context_attributes_not_none(attribute: str): | ||
def test_global_context_attributes_not_none(attribute: str) -> None: | ||
"""Attributes should be not None""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should not be None ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We add |
||
# Goal is to improve test coverage | ||
ctx = GlobalContext() | ||
ctx = GlobalContext().replace(workspace_client=mock_workspace_client(), sql_backend=MockBackend()) | ||
assert hasattr(ctx, attribute) | ||
assert getattr(ctx, attribute) is not None | ||
|
||
|
||
@pytest.mark.parametrize("attribute", ["local_file_migrator", "local_code_linter"]) | ||
def test_local_context_attributes_not_none(attribute: str): | ||
def test_local_context_attributes_not_none(attribute: str) -> None: | ||
"""Attributes should be not None""" | ||
# Goal is to improve test coverage | ||
client = mock_workspace_client() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's bad. For clarity class factory methods should always come before instance methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is bad nor good, it is a style issue, this is consistent with the code base