Hash: SHA1

Philipp von Weitershausen wrote:
> Tres Seaver wrote:
>>>Well, if you look closer you find that it uses pprint.pformat which always 
>>>the same on all machines (because it provides output sorted by the 
>>>dictionary key).
>>I see that in the implementation;  it isn't documented as part of
>>pprint's contract, however.
> Yes it is: http://python.org/doc/current/lib/module-pprint.html

I must be blind, but I don't see any occurrence of 'sort' on that page
or on the "PrettyPrinter Objects" page under it, nor in the pydoc output
nor the module docstring.

>>But the dictionary here is an *artifact* -- what you are really trying
>>to do would be expressed as individual assertions in a classic unit test:
>>  self.failUnless(IFiveUtilityRegistry.providedBy(utility_service))
>>  self.failIf(zapi.getSiteManager() is zapi.getGlobalSiteManager())
>>etc.  If you really want to test equality of dictionaries, then
>>'self.assertEqual' does the trick just fine.
> All I need is a means to get information from the view (which is our guinnea 
> pig component
> that tries to look up local stuff) to the functional test. Views typically 
> output strings,
> whether we're in doctests or not. So, in the end we're comparing strings. 
> pprint'ing a
> dictionary is just a convenient, but perhaps misleading way of doing this.

In that case, I would have added methods to the view and asserted their
return values, I think, even in a doctest.  De gustibus, perhaps.

- --
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to