From 86c201d0492c9cbe3c5786027467bafc7918737e Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Fri, 2 Aug 2024 00:50:33 +0800 Subject: [PATCH] run test_missing_return_value on python 3.10+ (#2637) 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):