Skip to content

Commit 124e3a4

Browse files
Explicit test to check if function can retrieve module into local namespace
1 parent d6b118a commit 124e3a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/it/script_scope.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
import numpy as np
3636
3737
def calculate_cbrt(age):
38-
return round(age ** (1. / 3))
38+
# check whether defined function can import module from global namespace
39+
if round(age ** (1. / 3)) == round(np.cbrt(age)):
40+
return round(age ** (1. /3))
3941
4042
cbrt_age = calculate_cbrt(age)
41-
# cbrt_age = round(math.cbrt(age))
4243
f"The rounded cube root of my age is {cbrt_age}"
4344
"""
4445
StringReader = scyjava.jimport("java.io.StringReader")

0 commit comments

Comments
 (0)