Re: [Zope-dev] Re: Unit Test Failures

2005-12-20 Thread Lennart Regebro
On the actual problem, this is a big red flag for me: 'isinstance(zapi.getSiteManager(), FiveSiteManager)': True, Fails. So, it's not a FivesiteManager. What is it? None, or something else? Since this seems to be a cleanup issue, my guess is: Something else. Probably another one of the site

Re: [Zope-dev] Re: Unit Test Failures

2005-12-20 Thread Philipp von Weitershausen
Lennart Regebro wrote: On the actual problem, this is a big red flag for me: 'isinstance(zapi.getSiteManager(), FiveSiteManager)': True, Fails. So, it's not a FivesiteManager. What is it? None, or something else? It's the global site manager if not the FiveSiteManager. Since this seems

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Tim Peters
[Benji York] The Zope2 unit tests have been failing for some time on buildbot.zope.com. Looks like a Five-related problem: http://buildbot.zope.org/Zope%20trunk%202.4%20Linux%20zc-buildbot/builds/109/test/0 [Tres Seaver] The failing test is a functional test, not a unit test; I don't run

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Philipp von Weitershausen
Jim Fulton wrote: This is really just a matter of knowing how to write the test. Generally, when you want to show a dict sample, the way to do it is with: from zope.testing/doctestunit import pprint pprint(thisdict) This formats the dictionary nicely and, most importantly, sorts the

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Philipp von Weitershausen
Tim Peters wrote: I'm not sure what it is testing, either; CC'ing Phillip, whose fingerprints are on it, according the 'svn blame', for clarification. These tests have always failed, and Phillip doesn't know why. Because they were failing, he changed them to run at level 2. That's not

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Tim Peters
[Tim] I opened a Collector issue on this about a month ago (I always run with `--all`, so these failures are old news to me): http://www.zope.org/Collectors/Zope/1947 [Philipp] Rereading that issue again, it's totally surprising to see that there's no failure on Windows, which makes

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Philipp von Weitershausen
Tim Peters wrote: I wouldn't know where to start (having tried to debug this problem in the past). Anyone got an idea? For a start, disabuse yourself of the illusion that it acts differently on Windows than on Linux ;-) Yup, sorry, misread the issue. Speed kills... :) Philipp

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Jim Fulton
Philipp von Weitershausen wrote: ... 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

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Philipp von Weitershausen
Jim Fulton wrote: Obviously, some other test isn't cleaning up after itself. Yes, that was obvious to me too. It was confusing that the same test would pass on Five 1.2, though, and I couldn't find any obvious differences. As trial and error usually takes time, I left the issue to be resolved

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Tim Peters
... [Philipp] 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). [Tres Seaver] I see that in the implementation; it isn't documented as part of pprint's contract, however.

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Philipp von Weitershausen
Tim Peters wrote: ... a good lecture on pprint vs. dicts Thanks, I'll be more careful about using pprint for dicts then. Philipp This message was sent using IMP, the Internet Messaging Program.

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Jim Fulton
Tim Peters wrote: ... [Philipp] 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). [Tres Seaver] I see that in the implementation; it isn't documented as part of

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Tim Peters
[Tim] Looks like Jim's suggested from zope.testing.doctestunit import pprint inherits this insecurity. [Jim] No, it doesn't. from zope.testing.doctestunit import pprint pprint({z: 1, m: 2}) {'m': 2, 'z': 1} Note both the sorting and the wrapping. See below. Cool! I

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Jim Fulton
Tim Peters wrote: ... Well, I understand why that works, but it's not part of pprint's contract either. What contract. :) Aren't you always telling me to read the source? Note that, in Python 2.4, you can now pass a width to pprint without creating a separate pretty printer: from pprint

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: Tim Peters wrote: ... Well, I understand why that works, but it's not part of pprint's contract either. What contract. :) The documented behavior, e.g. from '$ pydoc pprint' or the online equivalent,

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Jim Fulton
Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: Tim Peters wrote: ... Well, I understand why that works, but it's not part of pprint's contract either. What contract. :) The documented behavior, e.g. from '$ pydoc pprint' or the online equivalent,

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Tim Peters
... [Tim] Well, I understand why that works, but it's not part of pprint's contract either. [Jim] What contract. :) pprint's docs. Aren't you always telling me to read the source? Indeed, if you hadn't, you wouldn't have known that forcing width=1 forces dict sorting ;-) It's common as

Re: [Zope-dev] Re: Unit Test Failures

2005-12-19 Thread Fred Drake
On 12/19/05, Philipp von Weitershausen [EMAIL PROTECTED] wrote: Now I see what you mean by contract. You're right, I guess it isn't documented then, but perhaps it should be. That's never been part of the contract and, as Tres notes, it's inconsistent. The implmentation will only sort when