Abdullah bin Abbas reported,

"What is your concern with this verse? It was revealed only about the People of the Book." Then Ibn Abbas recited, "And when Allah took a covenant from those who were given the Scripture, that you shall make it clear to the people and not conceal it" [Al Imran 3:187], and he recited, "Do not think that those who rejoice in what they have brought about and love to be praised for what they have not done" [Al Imran 3:188].Ibn Abbas explained, "The Prophet ﷺ asked them about something, and they concealed it and told him something else instead. They left having given him the impression that they had informed him about what he had asked them, and they sought his praise for that, and they rejoiced in what they had gained by concealing what he had asked them about."

Tirmidhi 3014

Sahih

حدثنا الحسن بن محمد الزعفراني حدثنا الحجاج بن محمد قال قال ابن جريج أخبرني ابن أبي مليكة أن حميد بن عبد الرحمن بن عوف أخبره أن مروان بن الحكم قال اذهب يا رافع لبوابه إلى ابن عباس فقل له لئن كان كل امرئ فرح بما أوتي وأحب أن يحمد بما لم يفعل معذبا لنعذبن أجمعون

قال ابن عباس

ما لكم ولهذه الآية إنما أنزلت هذه في أهل الكتاب ثم تلا ابن عباس {وإذ أخذ الله ميثاق الذين أوتوا الكتاب لتبيننه للناس ولا تكتمونه} وتلا {لا تحسبن الذين يفرحون بما أتوا ويحبون أن يحمدوا بما لم يفعلوا} قال ابن عباس سألهم النبي ﷺ عن شيء فكتموه وأخبروه بغيره فخرجوا وقد أروه أن قد أخبروه بما قد سألهم عنه فاستحمدوا بذلك إليه وفرحوا بما أوتوا من كتمانهم ما سألهم عنه

الترمذي 3014صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Tafsir of the Quran
Chapter
From Surah Al Imran
Numbering
Darussalam 3014
Tirmidhi 3014