From 9ffc471378aa66d1e96094cc67c3b41337fb8091 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Thu, 1 Aug 2024 09:16:04 -0700 Subject: [PATCH] run test_missing_return_value on python 3.10+ Signed-off-by: Kevin Su --- tests/flytekit/unit/core/test_workflows.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/flytekit/unit/core/test_workflows.py b/tests/flytekit/unit/core/test_workflows.py index 8cb72aadec..efadf93f5f 100644 --- a/tests/flytekit/unit/core/test_workflows.py +++ b/tests/flytekit/unit/core/test_workflows.py @@ -236,6 +236,14 @@ def no_outputs_wf(): with pytest.raises(FlyteValueException): no_outputs_wf() + +@pytest.mark.skipif(sys.version_info < (3, 10, 10), reason="inspect module does not work correctly with Python <3.10.10. https://github.com/python/cpython/issues/102647#issuecomment-1466868212") +def test_missing_return_value(): + @task + def t1(a: int) -> int: + a = a + 5 + return a + # Should raise an exception because it doesn't return something when it should with pytest.raises(FlyteMissingReturnValueException):