If there is mold on the pesto, it is bad and cannot be eaten. If it smells moldy or sour, it is bad and cannot be eaten. If it has been in your fridge for 5 or more days after opening, it may be bad and should not be eaten.