[Zodb-checkins] CVS: ZODB4 - test.py:1.14

Jeremy Hylton jeremy@zope.com
Thu, 6 Mar 2003 13:36:28 -0500


Update of /cvs-repository/ZODB4
In directory cvs.zope.org:/tmp/cvs-serv19282

Modified Files:
	test.py 
Log Message:
Replace the existing test.py with a copy of the one from Zope3.


=== ZODB4/test.py 1.13 => 1.14 === (637/737 lines abridged)
--- ZODB4/test.py:1.13	Mon Dec 30 12:03:26 2002
+++ ZODB4/test.py	Thu Mar  6 13:36:27 2003
@@ -2,38 +2,44 @@
 #
 # Copyright (c) 2001, 2002 Zope Corporation and Contributors.
 # All Rights Reserved.
-#
+# 
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
-#
+# 
 ##############################################################################
-"""Run the test suite.
+"""
+test.py [-abCdgGLvvt] [modfilter [testfilter]]
+
+Test harness.
 
-Usage: %(PROGRAM)s [options] [modfilter [testfilter]]
-Options:
+-a level
+--all
+    Run the tests at the given level.  Any test at a level at or below this is
+    run, any test at a level above this is not run.  Level 0 runs all tests.
+    The default is to run tests at level 1.  --all is a shortcut for -a 0.
 
 -b
-    Run "python setup.py build" before running tests, where "python" is the
-    version of python used to run test.py.  Highly recommended.  Tests will be
-    run from the build directory.  (Note: In Python < 2.3 the -q flag is
-    added to the setup.py command line.)
+    Run "python setup.py build" before running tests, where "python"
+    is the version of python used to run test.py.  Highly recommended.
+    Tests will be run from the build directory.  (Note: In Python < 2.3
+    the -q flag is added to the setup.py command line.)
 
 -B
     Run "python setup.py build_ext -i" before running tests.  Tests will be
     run from the source directory.
 
--c
-    Use pychecker.
+-c  use pychecker
 
 -d

[-=- -=- -=- 637 lines omitted -=- -=- -=-]

         if bad:
             sys.exit(1)
     except ImportError, err:
         print err
         print sys.path
         raise
-
-
-def print_tb_last():
-    tb = sys.exc_info()[2]
-    file = sys.stderr
-    while True:
-        f = tb.tb_frame
-        lineno = traceback.tb_lineno(tb)
-        tb = tb.tb_next
-        if tb is not None:
-            continue
-
-        co = f.f_code
-        filename = co.co_filename
-        name = co.co_name
-        file.write('  File "%s", line %d, in %s\n' % (filename,lineno,name))
-        line = linecache.getline(filename, lineno)
-        if line:
-            file.write('    %s\n' % line.strip())
-        break
-
-
-# The following method is for debugging unit tests from a Python prompt:
-def debug(args=""):
-    """Debug your unit tests with the post mortem debugger.
-
-    Just run the debug function with a string containing command-line
-    arguments. (The function uses a cheesy parser, aka split. ;)
-
-    For example, to debug the tests in package Zope.App.DublinCore:
-
-      import test
-      test.debug('Zope.App.DublinCore')
-
-    At the first failure or error, an exception will be raised. At
-    that point, you can use pdb's post-mortem debugger:
-
-      import pdb
-      pdb.pm()
-    """
-    process_args(["", "-d"] + args.split())
 
 
 if __name__ == "__main__":