[Checkins] SVN: zope.formlib/trunk/src/zope/formlib/form.txt Fixed tests for Python2.4

Christophe Combelles ccomb at free.fr
Wed Mar 3 18:51:32 EST 2010


Zvezdan Petkovic a écrit :
> On Mar 3, 2010, at 4:12 PM, Christophe Combelles wrote:
> 
>> Log message for revision 109624:
>>  Fixed tests for Python2.4
> 
> What exactly did you fix?
> 
>> Modified: zope.formlib/trunk/src/zope/formlib/form.txt
>> ===================================================================
>> --- zope.formlib/trunk/src/zope/formlib/form.txt	2010-03-03 19:02:08 UTC (rev 109623)
>> +++ zope.formlib/trunk/src/zope/formlib/form.txt	2010-03-03 21:12:18 UTC (rev 109624)
>> @@ -235,7 +235,7 @@
>>
>>>>> request.form['form.min_size'] = u'42'
>>>>> request.form['form.max_size'] = u'142'
>> -    >>> pprint(MyForm(None, request)()) # doctest: +NORMALIZE_WHITESPACE
>> +    >>> values = MyForm(None, request)() # doctest: +NORMALIZE_WHITESPACE
>>     <input class="textType" id="form.name" name="form.name" size="20"
>>            type="text" value="bob"  />
>>     <input class="textType" id="form.min_size" name="form.min_size" size="10"
>> @@ -244,9 +244,8 @@
>>            type="text" value="142.0"  />
>>     <input class="textType" id="form.color" name="form.color" size="20"
>>            type="text" value=""  />
>> -    {'max_size': 142.0,
>> -     'min_size': 42.0,
>> -     'name': u'bob'}
>> +    >>> sorted(values.items())
>> +    [('max_size', 142.0), ('min_size', 42.0), ('name', u'bob')]
> 
> 
> As far as I can see you just wanted to enforce sorting.
> 
> Sorted lists are difficult to read compared to pprint output.
> 
> If you want pprint to sort the output even when it's short, just add a keyword parameter to the call: pprint.pprint(..., width=1).
> 
> That will enforce one item per line which will also produce sorted output but in a nicer format.
> 
> I'm reverting this checkin and applying the fix that keeps pprint format -- only sorted.


Thanks for the hint! I did'nt know that.
I've done the same on zope.app.apidoc and zope.app.keyreference.
Now there should be no more errors on ztk and zopeapp for py24

Christophe


> 
> 	Zvezdan
> 
> 
> 



More information about the checkins mailing list