Preheat the oven to 400°. In a large skillet, heat the 2 tablespoons of oil until shimmering. Add the mushrooms and season with salt and pepper. Cover and cook over moderate heat, stirring a few times, until softened, 4 minutes. Add the onion, cover and cook, stirring occasionally, until the onion is softened and the mushrooms are browned, 3 minutes longer. Add the sherry and cook until almost evaporated, 1 minute. Season with salt and pepper. Remove from the heat, cover and set aside.