I have been trying to see if there is an expression for this for a while now. You know when you're about to laugh or smile at something, but that would be inappropriate or embarrassing, so you force a frown but your eyes are still smiling? Is there an expression for this?
I don't think there is a single iconic word. I would say "suppressing X"; for example Suppressing the urge to laugh, or suppressing a grin, etc.
If you see it on someone else, you can tell because their is a smile around their eyes but their lips are compressed by the force they exert to hold in a grin or laugh.
So "holding in a grin".
There is nothing wrong with using a phrase or description. In general, when writing fiction, it is better to use a visual description employing commonly used words, than to use an obscure word or phrase that most of your audience won't understand. I think we are trying to aid the reader's imagination, not expand their vocabulary.
Perhaps if you are certain there IS a commonly understood word and you're having a brain glitch on it, go looking. Otherwise, just paint the picture with a handful of words.
How about keep a straight face?
Or maybe you could adapt some adjectives such as straight-faced, poker-faced, deadpan?