The Messenger of Allah ﷺ said to his uncle, "Say, 'There is no god but Allah,' and I will bear witness for you with it on the Day of Resurrection."His uncle replied, "Were it not that the Quraysh would taunt me, saying that nothing drove me to it but the fear of death, I would have delighted you with it."Then Allah revealed, "Indeed, you do not guide whom you love, but Allah guides whom He wills" [Qasas 28:56].
حدثنا محمد بن بشار حدثنا يحيى بن سعيد عن يزيد بن كيسان حدثني أبو حازم الأشجعي
قال رسول الله ﷺ لعمه قل لا إله إلا الله أشهد لك بها يوم القيامة قال لولا أن تعيرني بها قريش أن ما يحمله عليه الجزع لأقررت بها عينك فأنزل الله عز وجل {إنك لا تهدي من أحببت ولكن الله يهدي من يشاء}
Muslim also narrated it, in the Book of Faith, chapter "Evidence for the Validity of the Faith of One Whom Death Approaches, as Long as the Death Rattle Has Not Begun ...," hadith 25, from the hadith of Yahya, through the same route.