[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner- Removed an unnecessary (and thus, missleading) path manipulation in

Jim Fulton jim at zope.com
Sun Oct 9 12:34:36 EDT 2005


Log message for revision 39020:
  Removed an unnecessary (and thus, missleading) path manipulation in
  test setup.
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner-arguments.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-coverage.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-debugging.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-errors.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-layers-ntd.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-layers.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-progress.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-simple.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-test-selection.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-verbose.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-wo-source.txt

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner-arguments.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-arguments.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-arguments.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -8,14 +8,13 @@
 the testrunner just uses `sys.argv`.  It is possible to pass athiments
 explicitly.
 
-    >>> import os.path, sys
+    >>> import os.path
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-    >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
     ...     ]
+    >>> from zope.testing import testrunner
     >>> testrunner.run(defaults, 'test --layer 111'.split())
     Running samplelayers.Layer111 tests:
       Set up samplelayers.Layerx in N.NNN seconds.

Modified: zope.testing/trunk/src/zope/testing/testrunner-coverage.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-coverage.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-coverage.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -9,8 +9,6 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-    >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
@@ -18,6 +16,7 @@
 
     >>> sys.argv = 'test --coverage=coverage_dir'.split()
 
+    >>> from zope.testing import testrunner
     >>> testrunner.run(defaults)
     Running unit tests:
     ...

Modified: zope.testing/trunk/src/zope/testing/testrunner-debugging.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-debugging.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-debugging.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -21,7 +21,6 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
     >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,

Modified: zope.testing/trunk/src/zope/testing/testrunner-errors.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-errors.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-errors.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -8,7 +8,6 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
     >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,

Modified: zope.testing/trunk/src/zope/testing/testrunner-layers-ntd.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-layers-ntd.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-layers-ntd.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -10,7 +10,6 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
     >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,

Modified: zope.testing/trunk/src/zope/testing/testrunner-layers.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-layers.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-layers.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -8,14 +8,13 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-    >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
     ...     ]
 
     >>> sys.argv = 'test --layer 112 --layer unit'.split()
+    >>> from zope.testing import testrunner
     >>> testrunner.run(defaults)
     Running unit tests:
       Ran 192 tests with 0 failures and 0 errors in N.NNN seconds.

Modified: zope.testing/trunk/src/zope/testing/testrunner-progress.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-progress.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-progress.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -11,14 +11,13 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-    >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
     ...     ]
 
     >>> sys.argv = 'test --layer 122 -p'.split()
+    >>> from zope.testing import testrunner
     >>> testrunner.run(defaults)
     Running samplelayers.Layer122 tests:
       Set up samplelayers.Layer1 in 0.000 seconds.

Modified: zope.testing/trunk/src/zope/testing/testrunner-simple.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-simple.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-simple.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -14,22 +14,20 @@
 Typically, a test script does 2 things:
 
 - Adds the directory containing the zope package to the Python
-  path:
+  path.
 
-    >>> import os.path, sys
-    >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-
 - Calls the test runner with default arguments and arguments supplied
   to the script.
 
   Normally, it just passes default/setup arguments.  The test runner
   uses `sys.argv` to get the user's input.
 
-This directory contains a number of sample packages with tests.
-Let's run the tests found here. First though, we'll set up our default
-options:
+This testrunner_ex subdirectory contains a number of sample packages
+with tests.  Let's run the tests found here. First though, we'll set
+up our default options:
 
+    >>> import os.path
+    >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
@@ -49,6 +47,7 @@
 Now, if we run the tests, without any other options:
 
     >>> from zope.testing import testrunner
+    >>> import sys
     >>> sys.argv = ['test']
     >>> testrunner.run(defaults)
     Running unit tests:

Modified: zope.testing/trunk/src/zope/testing/testrunner-test-selection.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-test-selection.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-test-selection.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -10,14 +10,13 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-    >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
     ...     ]
 
     >>> sys.argv = 'test --layer 122 -ssample1 -vv'.split()
+    >>> from zope.testing import testrunner
     >>> testrunner.run(defaults)
     Running tests at level 1
     Running samplelayers.Layer122 tests:

Modified: zope.testing/trunk/src/zope/testing/testrunner-verbose.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-verbose.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-verbose.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -12,13 +12,12 @@
 
     >>> import os.path, sys
     >>> directory_with_tests = os.path.join(this_directory, 'testrunner-ex')
-    >>> sys.path.append(directory_with_tests)
-    >>> from zope.testing import testrunner
     >>> defaults = [
     ...     '--path', directory_with_tests,
     ...     '--tests-pattern', '^sampletestsf?$',
     ...     ]
     >>> sys.argv = 'test --layer 122 -v'.split()
+    >>> from zope.testing import testrunner
     >>> testrunner.run(defaults)
     Running tests at level 1
     Running samplelayers.Layer122 tests:

Modified: zope.testing/trunk/src/zope/testing/testrunner-wo-source.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-wo-source.txt	2005-10-09 16:34:26 UTC (rev 39019)
+++ zope.testing/trunk/src/zope/testing/testrunner-wo-source.txt	2005-10-09 16:34:35 UTC (rev 39020)
@@ -37,7 +37,6 @@
 Now run the tests in the copy:
 
 
-    >>> sys.path.append(directory_with_tests)
     >>> from zope.testing import testrunner
 
     >>> mydefaults = [



More information about the Zope3-Checkins mailing list