Withdrawing ourselves from the nuclear deal would significantly negatively impact the country's economy.
Also, we need to ask ourselves as to what are going to gain with the nuclear tests? Even if at a later date nuclear tests become unavoidable, no one can stop us from doing so and the consequence would be the cancellation of the agreement, which in any case does not exist as of today. We can revert to present scenario any time we want to.
China & Pakistan would be the happiest nations if the deal does not get thourgh.