[Zope3-checkins] CVS: Zope3 - test.py:1.36

Jeremy Hylton jeremy@zope.com
Wed, 19 Feb 2003 12:49:15 -0500


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv17805

Modified Files:
	test.py 
Log Message:
Merge features from ZODB3 test suite.

XXX Please test your favorite feature.  There is no test suite for the
test script :-).


=== Zope3/test.py 1.35 => 1.36 === (625/725 lines abridged)
--- Zope3/test.py:1.35	Wed Feb  5 09:15:48 2003
+++ Zope3/test.py	Wed Feb 19 12:49:14 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

[-=- -=- -=- 625 lines omitted -=- -=- -=-]

         if len(args) > 1:
             test_filter = args[1]
@@ -607,47 +637,6 @@
         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__":