Add before and after hooks to tests