From 124e3a4a630bb148c545f62271ee83cc87344706 Mon Sep 17 00:00:00 2001 From: ian-coccimiglio Date: Fri, 21 Mar 2025 15:11:33 -0700 Subject: [PATCH] Explicit test to check if function can retrieve module into local namespace --- tests/it/script_scope.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/it/script_scope.py b/tests/it/script_scope.py index 923bdaf..fc751fd 100644 --- a/tests/it/script_scope.py +++ b/tests/it/script_scope.py @@ -35,10 +35,11 @@ import numpy as np def calculate_cbrt(age): - return round(age ** (1. / 3)) + # check whether defined function can import module from global namespace + if round(age ** (1. / 3)) == round(np.cbrt(age)): + return round(age ** (1. /3)) cbrt_age = calculate_cbrt(age) -# cbrt_age = round(math.cbrt(age)) f"The rounded cube root of my age is {cbrt_age}" """ StringReader = scyjava.jimport("java.io.StringReader")