mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
#106: add callable to check if it is function
This commit is contained in:
@@ -705,8 +705,13 @@ class TestcaseParser(object):
|
|||||||
return self.functions[item_name]
|
return self.functions[item_name]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return eval(item_name)
|
# check if builtin functions
|
||||||
except NameError:
|
item_func = eval(item_name)
|
||||||
|
if callable(item_func):
|
||||||
|
# is builtin function
|
||||||
|
return item_func
|
||||||
|
except (NameError, TypeError):
|
||||||
|
# is not builtin function, continue to search
|
||||||
pass
|
pass
|
||||||
elif item_type == "variable":
|
elif item_type == "variable":
|
||||||
if item_name in self.variables:
|
if item_name in self.variables:
|
||||||
|
|||||||
Reference in New Issue
Block a user