[issue14796] Calendar module test coverage improved

2012-05-13 Thread Oleg Plakhotnyuk

New submission from Oleg Plakhotnyuk :

I've improved calendar.py test coverage a bit.

Before:
  41071%   calendar   (.../Lib/calendar.py)
After:
  41077%   calendar   (.../Lib/calendar.py)

--
components: Tests
files: test_calendar.patch
keywords: patch
messages: 160519
nosy: Oleg.Plakhotnyuk, giampaolo.rodola, ncoghlan, rhettinger
priority: normal
severity: normal
status: open
title: Calendar module test coverage improved
versions: Python 3.3
Added file: http://bugs.python.org/file25562/test_calendar.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Brett Cannon

Changes by Brett Cannon :


--
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-13 Thread R. David Murray

R. David Murray  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Oleg Plakhotnyuk

Oleg Plakhotnyuk  added the comment:

Thanks for the review.

I'll happily tune the patch myself. Just when I have some spare time again.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-18 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Removed file: http://bugs.python.org/file25562/test_calendar.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-18 Thread Oleg Plakhotnyuk

Oleg Plakhotnyuk  added the comment:

I didn't event know that there is such a handy assertRaisesRegex context.

Many thanks for pointing this out!

--
Added file: http://bugs.python.org/file25632/test_calendar.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-25 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Removed file: http://bugs.python.org/file25632/test_calendar.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-25 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Added file: http://bugs.python.org/file25705/test_calendar.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-29 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 98bc9e357f74 by R David Murray in branch 'default':
#14796: improve calendar test coverage.
http://hg.python.org/cpython/rev/98bc9e357f74

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-29 Thread R. David Murray

R. David Murray  added the comment:

Thanks, Oleg.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-30 Thread STINNER Victor

STINNER Victor  added the comment:

> 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

--
nosy: +haypo
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-30 Thread Roundup Robot

Roundup Robot  added the comment:

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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14796] Calendar module test coverage improved

2012-05-30 Thread R. David Murray

R. David Murray  added the comment:

The buildbots seem happy.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com