[Python-Dev] Re: Can't build Zope on Windows w/ 2.4.1c1 (original) (raw)

Tim Peters tim.peters at gmail.com
Thu Mar 10 22:05:06 CET 2005


[Tres Seaver]

Unit tests for Zope 2.7.4's 'zdaemon' package, which passed under Python 2.4, now fail under 2.4.1c1:

Are you sure they passed under 2.4? Derrick Hudson changed run() to _run() in the SVN version of zdaemon way back on Jan 19, with this checkin comment:

 Log message for revision 28881:
 Renamed run() method to _run().  Python 2.4's unittest.TestCase class
 defines all of the test logic in the run() method instead of in __call__()
 (as 2.3 did).  The rename prevents overriding the base implementation and
 causing the tests to fail.

 Changed:
 U   Zope3/trunk/src/zdaemon/tests/testzdrun.py

I then ported that to where it belonged (zdaemon isn't part of Zope3 under SVN, it's stitched in to Zope3, from time to time, from the distinct zdaemon SVN trunk).

I suppose that never got ported to the CVS version -- well, until today, cuz it looks like Stefan Holek checked in the same kinds of changes to testzdrun.py about 2.5 hours ago.

[BTW, the zdaemon tests don't run at all on Windows, so I'll never notice anything wrong with them]

$ uname -a _Linux secretariat 2.6.8.1-5-686 #1 Sat Feb 12 00:50:37 UTC 2005 i686 _ GNU/Linux $ ../Python-2.4/python test.py -v zdaemon Running unit tests at level 1 Running unit tests from /home/tseaver/projects/Zope-CVS/Zope-2.7.4/lib/python /home/tseaver/projects/Zope-CVS/Python-2.4/Lib/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module ~ DeprecationWarning) ............................ - ---------------------------------------------------------------------- Ran 28 tests in 2.278s

OK $ ../Python-2.4.1c1/python test.py -v zdaemon Running unit tests at level 1 Running unit tests from /home/tseaver/projects/Zope-CVS/Zope-2.7.4/lib/python /home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/whrandom.py:38: DeprecationWarning: the whrandom module is deprecated; please use the random module ~ DeprecationWarning) ...................Traceback (most recent call last): ~ File "test.py", line 918, in ? ~ processargs() ~ File "test.py", line 908, in processargs ~ bad = main(modulefilter, testfilter, libdir) ~ File "test.py", line 698, in main ~ runner(files, testfilter, debug) ~ File "test.py", line 599, in runner ~ r = runner.run(suite) ~ File "test.py", line 366, in run ~ return unittest.TextTestRunner.run(self, test) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 696, in run ~ test(result) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 428, in call ~ return self.run(*args, **kwds) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 424, in run ~ test(result) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 428, in call ~ return self.run(*args, **kwds) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 424, in run ~ test(result) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 428, in call ~ return self.run(*args, **kwds) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 424, in run ~ test(result) ~ File "/home/tseaver/projects/Zope-CVS/Python-2.4.1c1/Lib/unittest.py", line 281, in call ~ return self.run(*args, **kwds) ~ File "/home/tseaver/projects/Zope-CVS/Zope-2.7.4/lib/python/zdaemon/tests/testzdrun.py", line 97, in run ~ zdctl.main(["-s", self.zdsock] + args) AttributeError: 'ZDaemonTests' object has no attribute 'zdsock' By staring at the code of the failing test, it looks like the MRO of the testcase class has changed: it declares a 'run' method, which is supposed to run the external process, which clashes with the 'run' method of unittest.TestCase. I don't know what change in the 2.4 -> 2.4.1c1 update would have mucked with the MRO (if a MRO issue is involved). Tres.

Pretty baffling. I assume that if you did "cvs up", the test would pass now (because of Stefan's recent checkin).

Sounds anyway like an unintended unittest incompatibility snuck in somewhere between 2.3 and 2.4.



More information about the Python-Dev mailing list