Cook the potatoes in their skins in a large saucepan of salted boiling water for about 20 minutes, until tender. Drain and leave until cool enough to handle but not cold.
Meanwhile, make the sauce. Heat the oil in a frying pan, add the leek and cook over a medium heat for 5 minutes until tender. Add the garlic and tomatoes and cook for 5 minutes until the tomatoes are soft. Stir in the tomato purée and a little water to make a sauce. Add the sugar, season with salt and pepper and simmer for 3 minutes.
Peel off the potato skins and pass the potatoes through a potato ricer or mash with a potato masher until smooth. Season with salt and pepper, then knead in the flour to form a dough. Divide the gnocchi dough into 4 pieces and roll each piece into a thick sausage. Cut into 1.5 cm (¾ inch) pieces and press with the prongs of a fork to mark a ridged pattern.
Cook the gnocchi in a large saucepan of salted boiling water for 1–2 minutes until they float to the surface. Remove from the pan with a slotted spoon and add to the sauce. Add the basil and gently turn the gnocchi to coat in the sauce. Serve with an extra grinding of pepper.