[Checkins] SVN: zc.recipe.testrunner/trunk/ When:

Jim Fulton jim at zope.com
Wed Jan 24 11:28:16 EST 2007


Log message for revision 72216:
  When:
  
  + the working-directory option was used, 
    + and the test runner needed to restart itself
    + and the test runner was run with a relative path (e.g. bin/test)
  
  then the testrunner could not restart itself successfully because the
  relative path in sys.argv[0] was no-longer valid.
  
  Now we convert sys.argv[0] to an absolute path.
  

Changed:
  U   zc.recipe.testrunner/trunk/CHANGES.txt
  U   zc.recipe.testrunner/trunk/setup.py
  U   zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/README.txt
  U   zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py

-=-
Modified: zc.recipe.testrunner/trunk/CHANGES.txt
===================================================================
--- zc.recipe.testrunner/trunk/CHANGES.txt	2007-01-24 16:03:19 UTC (rev 72215)
+++ zc.recipe.testrunner/trunk/CHANGES.txt	2007-01-24 16:28:15 UTC (rev 72216)
@@ -2,6 +2,23 @@
 Change History
 **************
 
+1.0.0b5 (2007-01-24)
+====================
+
+Bugs fixed
+----------
+
+- When:
+
+  + the working-directory option was used, 
+  + and the test runner needed to restart itself
+  + and the test runner was run with a relative path (e.g. bin/test)
+
+  then the testrunner could not restart itself successfully because the
+  relative path in sys.argv[0] was no-longer valid.
+
+  Now we convert sys.argv[0] to an absolute path. 
+
 1.0.0b4 (2006-10-24)
 ====================
 

Modified: zc.recipe.testrunner/trunk/setup.py
===================================================================
--- zc.recipe.testrunner/trunk/setup.py	2007-01-24 16:03:19 UTC (rev 72215)
+++ zc.recipe.testrunner/trunk/setup.py	2007-01-24 16:28:15 UTC (rev 72216)
@@ -7,7 +7,7 @@
 name = "zc.recipe.testrunner"
 setup(
     name = name,
-    version = "1.0.0b4",
+    version = "1.0.0b5",
     author = "Jim Fulton",
     author_email = "jim at zope.com",
     description = "ZC Buildout recipe for creating test runners",

Modified: zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/README.txt
===================================================================
--- zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/README.txt	2007-01-24 16:03:19 UTC (rev 72215)
+++ zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/README.txt	2007-01-24 16:28:15 UTC (rev 72216)
@@ -251,6 +251,7 @@
       ]
     <BLANKLINE>
     import os
+    sys.argv[0] = os.path.abspath(sys.argv[0])
     os.chdir('/foo/bar')
     <BLANKLINE>
     import zope.testing.testrunner

Modified: zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py
===================================================================
--- zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py	2007-01-24 16:03:19 UTC (rev 72215)
+++ zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py	2007-01-24 16:28:15 UTC (rev 72216)
@@ -45,7 +45,7 @@
 
         wd = options.get('working-directory', '')
         if wd:
-            initialization = "import os\nos.chdir(%r)" % wd
+            initialization = initialization_template % wd
         else:
             initialization = ''
         
@@ -67,3 +67,6 @@
   '--test-path', %(TESTPATH)s,
   ]"""
                                  
+initialization_template = """import os
+sys.argv[0] = os.path.abspath(sys.argv[0])
+os.chdir(%r)"""



More information about the Checkins mailing list