[Checkins] SVN: zope.testrunner/trunk/src/zope/testrunner/testrunner-profiling.txt Oh, look, yet another test uses --profile and can conflict with itself.

Marius Gedminas cvs-admin at zope.org
Fri Feb 8 10:17:53 UTC 2013


Log message for revision 129216:
  Oh, look, yet another test uses --profile and can conflict with itself.
  
  

Changed:
  U   zope.testrunner/trunk/src/zope/testrunner/testrunner-profiling.txt

-=-
Modified: zope.testrunner/trunk/src/zope/testrunner/testrunner-profiling.txt
===================================================================
--- zope.testrunner/trunk/src/zope/testrunner/testrunner-profiling.txt	2013-02-08 10:14:22 UTC (rev 129215)
+++ zope.testrunner/trunk/src/zope/testrunner/testrunner-profiling.txt	2013-02-08 10:17:53 UTC (rev 129216)
@@ -3,7 +3,7 @@
 The testrunner supports hotshot and cProfile profilers. Hotshot profiler
 support does not work with python2.6
 
-    >>> import os.path, sys
+    >>> import os.path, sys, tempfile
     >>> profiler = '--profile=hotshot'
     >>> if sys.hexversion >= 0x02060000:
     ...     profiler = '--profile=cProfile'
@@ -14,9 +14,12 @@
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
     >>> sys.path.append(directory_with_tests)
 
+    >>> tempdir = tempfile.mkdtemp(prefix='zope.testrunner-')
+
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
+    ...     '--profile-directory', tempdir,
     ...     ]
 
     >>> sys.argv = [testrunner_script, profiler]
@@ -56,6 +59,5 @@
 
 It deletes these when rerun.  We'll delete these ourselves:
 
-    >>> import os
-    >>> for f in files:
-    ...     os.unlink(f)
+    >>> import shutil
+    >>> shutil.rmtree(tempdir)



More information about the checkins mailing list