I don't think when anyone uses "pessimism" or "optimism" in these ways that they mean modern philosophers were happy people who always look on the bright side or that postmodern philosophers are glum. Instead, they mean they are optimistic or pessimistic about what many see as the project of philosophy.
I think it's fair to say that modernism is, in general, "optimistic," but we need to be careful about how we are defining optimism. By optimism here, I mean that modernism is optimistic that (a) we can have true knowledge of some sort, (b) that we can share a concept of the world and knowledge, and (c) that logic or reason or something like it is universal.
Post-Modernism is harder to pin down. The big problem here is that since it's still in progress, it's not entirely clear what the term refers to. Postmodern philosophies are, in general, pessimistic about the possibilities listed above. That is to say they don't think we have a shared universal concept of reason or that we can attain true knowledge or that there is a universal valid form of reasoning that isn't limited.
Now, the paragraph about postmodernism above needs to be qualified with a nearly endless string of qualifiers. There may be some post-modern thinkers who think there's something like universal true reason (I can't think of any off the top of my head who traditionally fit the label -- but in part that's how the label gets diced). People who I'd say squarely seem to reject on the surface the modern project: Foucault, Derrida, Lyotard, Rorty. I'm sure there's many more. But even in putting say Derrida's name on the list, that greatly depends on which texts we're talking about and whether his critique of the use of concepts like "justice" is because he believes and hope for a deeper justice or because he believes there's no hope.
To give further fuel to the question, is Jean-Luc Marion a post-modern philosopher? Is Emmanuel Levinas? Paul Ricoeur? Merold Westphal?