[Checkins] SVN: zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/ check for existence of the part dir before creating it

Thomas Lotze tl at gocept.com
Sun Feb 25 16:11:50 EST 2007


Log message for revision 72804:
  check for existence of the part dir before creating it
  (since update is install, the dir won't get removed on update)

Changed:
  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/src/zc/recipe/testrunner/README.txt
===================================================================
--- zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/README.txt	2007-02-25 20:38:55 UTC (rev 72803)
+++ zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/README.txt	2007-02-25 21:11:50 UTC (rev 72804)
@@ -147,9 +147,19 @@
 
 We also get a part directory for the tests to run in:
 
-    >>> ls (sample_buildout, 'parts')
+    >>> ls(sample_buildout, 'parts')
     d  testdemo
 
+And updating leaves its contents intact:
+
+    >>> _ = system(os.path.join(sample_buildout, 'bin', 'test') +
+    ...            ' -q --coverage=coverage')
+    >>> ls(sample_buildout, 'parts', 'testdemo')
+    d  coverage
+    >>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
+    >>> ls(sample_buildout, 'parts', 'testdemo')
+    d  coverage
+
 We can run the test script to run our demo test:
 
     >>> print system(os.path.join(sample_buildout, 'bin', 'test') + ' -vv'),

Modified: zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py
===================================================================
--- zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py	2007-02-25 20:38:55 UTC (rev 72803)
+++ zc.recipe.testrunner/trunk/src/zc/recipe/testrunner/__init__.py	2007-02-25 21:11:50 UTC (rev 72804)
@@ -50,7 +50,10 @@
         wd = options.get('working-directory', '')
         if not wd:
             wd = options['location']
-            os.mkdir(wd)
+            if os.path.exists(wd):
+                assert os.path.isdir(wd)
+            else:
+                os.mkdir(wd)
             dest.append(wd)
         initialization = initialization_template % wd
         



More information about the Checkins mailing list