def test_pryear(self): with support.captured_stdout() as out: calendar.TextCalendar().pryear(2004) self.assertEqual(out.getvalue().strip(), result_2004_text.strip())