This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年05月13日 16:06 by Oleg.Plakhotnyuk, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_calendar.patch | Oleg.Plakhotnyuk, 2012年05月25日 15:36 | review | ||
| Messages (9) | |||
|---|---|---|---|
| msg160519 - (view) | Author: Oleg Plakhotnyuk (Oleg.Plakhotnyuk) * | Date: 2012年05月13日 16:06 | |
I've improved calendar.py test coverage a bit. Before: 410 71% calendar (.../Lib/calendar.py) After: 410 77% calendar (.../Lib/calendar.py) |
|||
| msg160527 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年05月13日 17:13 | |
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) |
|||
| msg160540 - (view) | Author: Oleg Plakhotnyuk (Oleg.Plakhotnyuk) * | Date: 2012年05月13日 18:08 | |
Thanks for the review. I'll happily tune the patch myself. Just when I have some spare time again. |
|||
| msg161061 - (view) | Author: Oleg Plakhotnyuk (Oleg.Plakhotnyuk) * | Date: 2012年05月18日 16:26 | |
I didn't event know that there is such a handy assertRaisesRegex context. Many thanks for pointing this out! |
|||
| msg161901 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年05月29日 16:55 | |
New changeset 98bc9e357f74 by R David Murray in branch 'default': #14796: improve calendar test coverage. http://hg.python.org/cpython/rev/98bc9e357f74 |
|||
| msg161902 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年05月29日 16:56 | |
Thanks, Oleg. |
|||
| msg161934 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年05月30日 08:21 | |
> New changeset 98bc9e357f74 by R David Murray in branch 'default': > #14796: improve calendar test coverage. > http://hg.python.org/cpython/rev/98bc9e357f74 The following added test fails on Windows: ... + def test_yeardatescalendar(self): + def shrink(cal): + return [[[' '.join((d.strftime('%D') + for d in z)) for z in y] for y in x] for x in cal] self.assertEqual( - cal.formatyearpage(2004, encoding=encoding).strip(b' \t\n'), - result_2004_html.strip(' \t\n').encode(encoding) + shrink(calendar.Calendar().yeardatescalendar(2004)), + result_2004_dates + ) ... The "%D" format is not supported by strftime(). Extract of timemodule.c: #if defined(MS_WINDOWS) && !defined(HAVE_WCSFTIME) /* check that the format string contains only valid directives */ for(outbuf = strchr(fmt, '%'); outbuf != NULL; outbuf = strchr(outbuf+2, '%')) { if (outbuf[1]=='#') ++outbuf; /* not documented by python, */ if (outbuf[1]=='0円' || !strchr("aAbBcdHIjmMpSUwWxXyYzZ%", outbuf[1])) { PyErr_SetString(PyExc_ValueError, "Invalid format string"); Py_DECREF(format); return NULL; } } #endif |
|||
| msg161947 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年05月30日 12:11 | |
New changeset d3321c010af5 by R David Murray in branch 'default': #14796: fix failure of new calendar test on windows. http://hg.python.org/cpython/rev/d3321c010af5 |
|||
| msg161949 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年05月30日 13:44 | |
The buildbots seem happy. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:30 | admin | set | github: 59001 |
| 2012年05月30日 13:44:18 | r.david.murray | set | status: open -> closed messages: + msg161949 |
| 2012年05月30日 12:11:02 | python-dev | set | messages: + msg161947 |
| 2012年05月30日 08:21:07 | vstinner | set | status: closed -> open nosy: + vstinner messages: + msg161934 resolution: fixed -> |
| 2012年05月29日 16:56:12 | r.david.murray | set | status: open -> closed resolution: fixed messages: + msg161902 stage: patch review -> resolved |
| 2012年05月29日 16:55:30 | python-dev | set | nosy:
+ python-dev messages: + msg161901 |
| 2012年05月25日 15:36:24 | Oleg.Plakhotnyuk | set | files: + test_calendar.patch |
| 2012年05月25日 15:36:10 | Oleg.Plakhotnyuk | set | files: - test_calendar.patch |
| 2012年05月18日 16:26:14 | Oleg.Plakhotnyuk | set | files:
+ test_calendar.patch messages: + msg161061 |
| 2012年05月18日 16:23:42 | Oleg.Plakhotnyuk | set | files: - test_calendar.patch |
| 2012年05月13日 18:08:22 | Oleg.Plakhotnyuk | set | messages: + msg160540 |
| 2012年05月13日 17:13:39 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg160527 |
| 2012年05月13日 16:35:45 | ezio.melotti | set | nosy:
+ ezio.melotti type: enhancement |
| 2012年05月13日 16:28:53 | brett.cannon | set | stage: patch review |
| 2012年05月13日 16:06:10 | Oleg.Plakhotnyuk | create | |