When I try to import a module to run it with specific inputs, the beginning part of the python script i'm calling gets run too which asks me for user input. I am not allowed to change the contents of that file in any way. How can I suppress that beginning part from running and just test the function I want to test in isolation?
module_path = os.path.join(root_dir, _dir, filename)
mod = imp.load_source(modified_file, module_path)
point_counter = 0
if(mod.Function(2, 5) != True):
point_counter+=1
if(mod.Function(2, 4) != False):
point_counter+=1