Skip to content

Commit 5599e7e

Browse files
authored
Merge pull request #374 from datacamp/visit_return
Add test for function calls in return statements
2 parents 9d76560 + f1a5b8c commit 5599e7e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_check_function.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,3 +500,10 @@ def test_test_function_v2_no_sig():
500500
s.check_function("numpy.arange", signature=False)
501501
with pytest.raises(InstructorError):
502502
s.check_function("numpy.arange")
503+
504+
505+
def test_function_call_in_return():
506+
code = "def my_func(a): return my_func_in_return(b)"
507+
sct = "Ex().check_function_def('my_func').check_body().check_function('my_func_in_return', signature=False)"
508+
res = helper.run({"DC_CODE": code, "DC_SOLUTION": code, "DC_SCT": sct})
509+
assert res["correct"]

0 commit comments

Comments
 (0)