mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-21 12:33:59 +08:00
refactor is_function
This commit is contained in:
@@ -239,7 +239,7 @@ def load_module_functions(module):
|
||||
module_functions = {}
|
||||
|
||||
for name, item in vars(module).items():
|
||||
if validator.is_function((name, item)):
|
||||
if validator.is_function(item):
|
||||
module_functions[name] = item
|
||||
|
||||
return module_functions
|
||||
|
||||
@@ -105,10 +105,9 @@ def is_testcase_path(path):
|
||||
###############################################################################
|
||||
|
||||
|
||||
def is_function(tup):
|
||||
""" Takes (name, object) tuple, returns True if it is a function.
|
||||
def is_function(item):
|
||||
""" Takes item object, returns True if it is a function.
|
||||
"""
|
||||
name, item = tup
|
||||
return isinstance(item, types.FunctionType)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user