Skip to content

Commit

Permalink
Rename test tasks and fix test_get_entities_in_file
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
  • Loading branch information
Tom-Newton committed Sep 23, 2024
1 parent 928bee3 commit 604f07c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
22 changes: 14 additions & 8 deletions tests/flytekit/unit/cli/pyflyte/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,16 @@ def test_union_type1(input):
@pytest.mark.parametrize(
"extra_cli_args, task_name, expected_output",
[
(("--a",), "test_task_boolean", True),
(("--no_a",), "test_task_boolean", False),
(("--a",), "test_boolean", True),
(("--no_a",), "test_boolean", False),
(tuple(), "test_task_boolean_default_true", True),
(("--a",), "test_task_boolean_default_true", True),
(("--no_a",), "test_task_boolean_default_true", False),
(tuple(), "test_boolean_default_true", True),
(("--a",), "test_boolean_default_true", True),
(("--no_a",), "test_boolean_default_true", False),
(tuple(), "test_task_boolean_default_false", False),
(("--a",), "test_task_boolean_default_false", True),
(("--no_a",), "test_task_boolean_default_false", False),
(tuple(), "test_boolean_default_false", False),
(("--a",), "test_boolean_default_false", True),
(("--no_a",), "test_boolean_default_false", False),
],
)
def test_boolean_type(extra_cli_args, task_name, expected_output):
Expand Down Expand Up @@ -422,6 +422,9 @@ def test_get_entities_in_file(workflow_file):
"task_with_env_vars",
"task_with_list",
"task_with_optional",
"test_boolean",
"test_boolean_default_false",
"test_boolean_default_true",
"test_union1",
"test_union2",
]
Expand All @@ -436,6 +439,9 @@ def test_get_entities_in_file(workflow_file):
"task_with_env_vars",
"task_with_list",
"task_with_optional",
"test_boolean",
"test_boolean_default_false",
"test_boolean_default_true",
"test_union1",
"test_union2",
]
Expand Down
6 changes: 3 additions & 3 deletions tests/flytekit/unit/cli/pyflyte/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ def test_union2(a: typing.Union[float, typing.List[int], MyDataclass]):
print(a)

@task
def test_task_boolean(a: bool):
def test_boolean(a: bool):
print(a)

@task
def test_task_boolean_default_true(a: bool = True):
def test_boolean_default_true(a: bool = True):
print(a)

@task
def test_task_boolean_default_false(a: bool = False):
def test_boolean_default_false(a: bool = False):
print(a)


Expand Down

0 comments on commit 604f07c

Please sign in to comment.