[Zodb-checkins] CVS: ZODB3 - test.py:1.24

Jeremy Hylton jeremy at zope.com
Thu Apr 24 12:53:01 EDT 2003


Update of /cvs-repository/ZODB3
In directory cvs.zope.org:/tmp/cvs-serv6540

Modified Files:
	test.py 
Log Message:
Python 2.1 compatibility


=== ZODB3/test.py 1.23 => 1.24 ===
--- ZODB3/test.py:1.23	Wed Apr 23 15:59:30 2003
+++ ZODB3/test.py	Thu Apr 24 11:53:00 2003
@@ -157,17 +157,17 @@
     __super_startTest = unittest._TextTestResult.startTest
     __super_printErrors = unittest._TextTestResult.printErrors
 
-    def __init__(self, stream, descriptions, verbosity, debug=False,
-                 count=None, progress=False):
+    def __init__(self, stream, descriptions, verbosity, debug=0,
+                 count=None, progress=0):
         self.__super_init(stream, descriptions, verbosity)
         self._debug = debug
         self._progress = progress
-        self._progressWithNames = False
+        self._progressWithNames = 0
         self._count = count
         self._testtimes = {}
         if progress and verbosity == 1:
-            self.dots = False
-            self._progressWithNames = True
+            self.dots = 0
+            self._progressWithNames = 1
             self._lastWidth = 0
             try:
                 import curses
@@ -314,9 +314,9 @@
         if self.inplace is None:
             # Need to figure it out
             if os.path.isdir(os.path.join("build", "lib.%s" % PLAT_SPEC)):
-                self.inplace = False
+                self.inplace = 0
             else:
-                self.inplace = True
+                self.inplace = 1
         # Calculate which directories we're going to add to sys.path, and cd
         # to the appropriate working directory
         org_cwd = os.getcwd()
@@ -351,7 +351,7 @@
 
 def match(rx, s):
     if not rx:
-        return True
+        return 1
     if rx[0] == "!":
         return re.search(rx[1:], s) is None
     else:
@@ -572,7 +572,7 @@
         if REFCOUNT:
             rc = sys.gettotalrefcount()
             track = TrackRefs()
-        while True:
+        while 1:
             runner(files, test_filter, debug)
             gc.collect()
             if gc.garbage:
@@ -613,23 +613,23 @@
     module_filter = None
     test_filter = None
     VERBOSE = 0
-    LOOP = False
-    GUI = False
-    TRACE = False
-    REFCOUNT = False
-    debug = False # Don't collect test results; simply let tests crash
-    debugger = False
-    build = False
-    build_inplace = False
+    LOOP = 0
+    GUI = 0
+    TRACE = 0
+    REFCOUNT = 0
+    debug = 0 # Don't collect test results; simply let tests crash
+    debugger = 0
+    build = 0
+    build_inplace = 0
     gcthresh = None
     gcdebug = 0
     gcflags = []
     level = 1
     libdir = None
-    progress = False
+    progress = 0
     timesfn = None
     timetests = 0
-    functional = False
+    functional = 0
 
     try:
         opts, args = getopt.getopt(argv[1:], "a:bBcdDfg:G:hLmprtTuv",
@@ -645,21 +645,21 @@
         elif k == "--all":
             level = 0
         elif k == "-b":
-            build = True
+            build = 1
         elif k == "-B":
-             build = build_inplace = True
+             build = build_inplace = 1
         elif k == "-c":
             # make sure you have a recent version of pychecker
             if not os.environ.get("PYCHECKER"):
                 os.environ["PYCHECKER"] = "-q"
             import pychecker.checker
         elif k == "-d":
-            debug = True
+            debug = 1
         elif k == "-D":
-            debug = True
-            debugger = True
+            debug = 1
+            debugger = 1
         elif k == "-f":
-            functional = True
+            functional = 1
         elif k in ("-h", "--help"):
             print __doc__
             sys.exit(0)
@@ -677,14 +677,14 @@
         elif k == "-m":
             GUI = "minimal"
         elif k == "-p":
-            progress = True
+            progress = 1
         elif k == "-r":
             if hasattr(sys, "gettotalrefcount"):
-                REFCOUNT = True
+                REFCOUNT = 1
             else:
                 print "-r ignored, because it needs a debug build of Python"
         elif k == "-T":
-            TRACE = True
+            TRACE = 1
         elif k == "-t":
             if not timetests:
                 timetests = 50
@@ -760,7 +760,7 @@
             tracer.runctx("main(module_filter, test_filter, libdir)",
                           globals=globals(), locals=vars())
             r = tracer.results()
-            r.write_results(show_missing=True, summary=True, coverdir=coverdir)
+            r.write_results(show_missing=1, summary=1, coverdir=coverdir)
         else:
             bad = main(module_filter, test_filter, libdir)
             if bad:




More information about the Zodb-checkins mailing list