Skip to content

Commit 5a0e5d5

Browse files
authored
Add integration tests for ManualTask (#673)
* Register KNOWN_VARIANTS to test tasks * Add tests for ManualTask * Fix type hints
1 parent bbdd85b commit 5a0e5d5

File tree

5 files changed

+454
-20
lines changed

5 files changed

+454
-20
lines changed

tests/integration/test_auto_task.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def exc_task() -> None:
8080
[(1, 2, 1), (2, 101, 10), (3, 4096, 12), (65535, 1, 2)],
8181
ids=str,
8282
)
83-
def test_input_output(self, shape: tuple[int]) -> None:
83+
def test_input_output(self, shape: tuple[int, ...]) -> None:
8484
runtime = get_legate_runtime()
8585
auto_task = runtime.create_auto_task(
8686
runtime.core_library, tasks.copy_store_task.task_id
@@ -190,7 +190,9 @@ def test_mixed_input(self) -> None:
190190
],
191191
ids=["accessed", "unaccessed"],
192192
)
193-
def test_uninitialized_input_store(self, shape, accessed) -> None:
193+
def test_uninitialized_input_store(
194+
self, shape: tuple[int, ...], accessed: bool
195+
) -> None:
194196
runtime = get_legate_runtime()
195197
auto_task = runtime.create_auto_task(
196198
runtime.core_library, tasks.copy_store_task.task_id
@@ -245,7 +247,7 @@ def test_add_scalar_arg_without_type(self) -> None:
245247
@pytest.mark.parametrize(
246248
"dtype", [(ty.int32, ty.int64), (np.int32,)], ids=str
247249
)
248-
def test_unsupported_scalar_arg_type(self, dtype: tuple[Any]) -> None:
250+
def test_unsupported_scalar_arg_type(self, dtype: tuple[Any, ...]) -> None:
249251
runtime = get_legate_runtime()
250252
auto_task = runtime.create_auto_task(
251253
runtime.core_library, tasks.basic_task.task_id
@@ -302,7 +304,10 @@ def test_alignment_non_input(self) -> None:
302304
tmp_store = runtime.create_store(ty.int32, (1,))
303305
auto_task.add_input(in_store)
304306
auto_task.add_alignment(in_store, tmp_store)
305-
with pytest.raises(IndexError, match="_Map_base::at"):
307+
# not asserting on the error message for this particular case due to
308+
# the message being unintuitive and may be compiler-dependent
309+
# match="unordered_map::at"
310+
with pytest.raises(IndexError):
306311
auto_task.execute()
307312
runtime.issue_execution_fence(block=True)
308313

0 commit comments

Comments
 (0)