Heat oven to 425 degrees F. On a large rimmed baking sheet, toss the beans with 1 tablespoon oil, then the Parmesan and ¼ teaspoon each salt and pepper. Roast until light golden brown, 10 to 12 minutes.
Meanwhile, heat the remaining tablespoon oil in a large skillet over medium-high heat. Season the cod with ¼ teaspoon each salt and pepper and cook until golden brown and opaque throughout, about 3 minutes per side; transfer to plates.
Spoon the pesto over the cod and serve with the beans.
