Tres Seaver wrote:
> > Well, if you look closer you find that it uses pprint.pformat which always 
> > outputs
> > 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:

> 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.


This message was sent using IMP, the Internet Messaging Program.
Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to