Hash: SHA1

Philipp von Weitershausen wrote:
> Tres Seaver wrote:
>>Benji York wrote:
>>>The Zope2 unit tests have been failing for some time on
>>>buildbot.zope.com.  Looks like a Five-related problem:
>>The failing test is a functional test, not a unit test;  I don't run
>>them by default when I check in.
> Actually, I put this particular test (functional.txt) on level=2 because it 
> would fail
> when run together with other Five tests. It passes fine when run by itself. 
> This test
> exists identically in Five 1.2 (based on Zope 2.8) where it passes just fine 
> when run
> together with other tests and by itself. During the hot phase of making the 
> deadline on
> November 1st, I decided that this wasn't a big issue and could be resolved 
> during the
> beta phase (after all, the test passes by itself). I obviously forgot to look 
> into it
> again, but then again, I still don't know what the heck is wrong with this.
>> I see a couple of problem points: the biggest is the use in the
>> output of 'checkSiteManager.html' of a repr'ed dict, which might
>> render differently between different machines (or even the same
>> machine across Python versions).
> 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.

>> This is a classic case where the "doctest" does *not* provide
>> clarity over a "traditional" 'unittest' style test, IMNSHO.
> Comparing dictionaries is not trivial in classic javiotic tests, either. 
> Using pprint is
> actually quite an elegant way, I think.

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.failIf(zapi.getSiteManager() is zapi.getGlobalSiteManager())

etc.  If you really want to test equality of dictionaries, then
'self.assertEqual' does the trick just fine.

>>I'm not sure what it is testing, either;
> It's testing how local site managers get found during traversal and how that 
> affects
> component lookup of e.g. views (depending on which site is traversed, you 
> would find
> local components or not).

OK, thanks!

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