[issue14796] Calendar module test coverage improved

R. David Murray report at bugs.python.org
Sun May 13 19:13:39 CEST 2012


R. David Murray <rdmurray at bitdance.com> added the comment:

Thanks for the patch.

There are a couple of things I'd change, which I or someone could do while committing if you prefer, but if you'd like to tune up the patch yourself that would be great.

The first is that I'd break up the tests that run more than one test into separate test methods (test_formatweekheader, test_formatmonthname, test_output_htmlcalendar).  The second is that the exception tests can be written more compactly (and IMO more legibly) like this:

    def test_illegal_month_reported(self):
        with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
            calendar.monthrange(2004, 65)

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14796>
_______________________________________


More information about the Python-bugs-list mailing list