def run_local_test()

in dynalab_cli/test.py [0:0]


    def run_local_test(self, config):
        # load handler
        sys.path.append(os.getcwd())
        handler_spec = importlib.util.spec_from_file_location(
            "handler", config["handler"]
        )
        handler = importlib.util.module_from_spec(handler_spec)
        handler_spec.loader.exec_module(handler)

        # load taskIO
        task_io = importlib.import_module(f"dynalab.tasks.task_io").TaskIO(
            config["task"]
        )
        try:
            task_io.mock_handle_individually(
                self.args.name, self.use_gpu(config), handler.handle
            )
        except Exception as e:
            raise RuntimeError(f"Local test failed because of: {e}")
        else:
            print("Local test passed")