[Zope3-checkins] SVN: Zope3/trunk/ - fix test runner's removal of its path from sys.path on Windows

Benji York benji at zope.com
Fri Oct 14 23:42:02 EDT 2005


Log message for revision 39459:
  - fix test runner's removal of its path from sys.path on Windows
  - whitespace fixes
  

Changed:
  U   Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py
  U   Zope3/trunk/test.py

-=-
Modified: Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py	2005-10-15 00:42:58 UTC (rev 39458)
+++ Zope3/trunk/src/zope/app/apidoc/codemodule/browser/ftests.py	2005-10-15 03:42:02 UTC (rev 39459)
@@ -24,7 +24,7 @@
     """Just a couple of tests ensuring that the templates render."""
 
     def testMenu(self):
-        response = self.publish('/++apidoc++/Code/menu.html', 
+        response = self.publish('/++apidoc++/Code/menu.html',
                                 basic='mgr:mgrpw')
         self.assertEqual(response.getStatus(), 200)
         body = response.getBody()
@@ -93,8 +93,8 @@
         self.checkForBrokenLinks(
             body, '/++apidoc++/Code/zope/app/apidoc/configure.zcml/index.html',
             basic='mgr:mgrpw')
-        
 
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(CodeModuleTests),

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py	2005-10-15 00:42:58 UTC (rev 39458)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/ftests.py	2005-10-15 03:42:02 UTC (rev 39459)
@@ -23,7 +23,7 @@
 
     def testMenu(self):
         response = self.publish(
-            '/++apidoc++/Interface/menu.html', 
+            '/++apidoc++/Interface/menu.html',
             basic='mgr:mgrpw',
             env = {'name_only': True, 'search_str': 'IComponent'})
         self.assertEqual(response.getStatus(), 200)
@@ -46,11 +46,11 @@
             body,
             '/++apidoc++/Interface'
             '/zope.app.apidoc.ifacemodule.IInterfaceModule'
-            '/apiindex.html',            
+            '/apiindex.html',
             basic='mgr:mgrpw')
-        
-    
 
+
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(InterfaceModuleTests),

Modified: Zope3/trunk/test.py
===================================================================
--- Zope3/trunk/test.py	2005-10-15 00:42:58 UTC (rev 39458)
+++ Zope3/trunk/test.py	2005-10-15 03:42:02 UTC (rev 39459)
@@ -18,11 +18,13 @@
 """
 import sys, os
 
-sys.path[:] = sys.path[1:]
-
 here = os.path.dirname(os.path.realpath(__file__))
 sys.path.insert(0, os.path.join(here, 'src'))
 
+# remove the current directory from the path, otherwise if we try to
+# import the standard library package "test", we get this file instead
+sys.path[:] = [p for p in sys.path if p != here]
+
 import zope.app.testing.test
 
 if __name__ == '__main__':



More information about the Zope3-Checkins mailing list