@Test
public void testPythonExecutorReleasedAfterSuccessExecution() {

    final PythonExecutor pythonExecutor = mock(PythonExecutor.class);
    PythonExecutionCachedEngine engine = new PythonExecutionCachedEngine() {
        public PythonExecutor allocateExecutor(Set<String> dependencies) {
            return pythonExecutor;
        }
    };
    engine.exec(Collections.<String>emptySet(),"", new HashMap<String, Serializable>());
    verify(pythonExecutor).release();
}