Add olive oil to a large pan over medium heat.
Add cherry tomatoes, season with salt and black pepper, and cook for a few minutes.
Stir, then cover with a lid and let cook another 10 minutes, until the tomatoes are soft and bursting.
Mash the tomatoes gently with a wooden spoon to release their juices.
Stir in the pesto and parmesan cheese. Lower the heat.
Add cooked spaghetti and a splash of reserved pasta water. Toss until the sauce coats the pasta evenly, adding more water if needed.
