[Zope3-checkins] CVS: ZODB4/src/zodb/zeo/tests - basethread.py:1.1.2.1 commitlock.py:1.7.6.3 invalid.py:1.1.2.3 testthread.py:NONE

Tim Peters tim.one@comcast.net
Thu, 19 Jun 2003 11:35:37 -0400


Update of /cvs-repository/ZODB4/src/zodb/zeo/tests
In directory cvs.zope.org:/tmp/cvs-serv26647/src/zodb/zeo/tests

Modified Files:
      Tag: ZODB3-2-merge
	commitlock.py invalid.py 
Added Files:
      Tag: ZODB3-2-merge
	basethread.py 
Removed Files:
      Tag: ZODB3-2-merge
	testthread.py 
Log Message:
Renamed testthread.py to basethread.py.  The "test" prefix confused
the test runner, as this file doesn't contain any tests (it contains
a base thread class for use by tests).


=== Added File ZODB4/src/zodb/zeo/tests/basethread.py ===
##############################################################################
#
# Copyright (c) 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
#
##############################################################################
"""A Thread base class for use with unittest."""

from cStringIO import StringIO
import threading
import traceback

class TestThread(threading.Thread):
    __super_init = threading.Thread.__init__
    __super_run = threading.Thread.run

    def __init__(self, testcase, group=None, target=None, name=None,
                 args=(), kwargs={}, verbose=None):
        self.__super_init(group, target, name, args, kwargs, verbose)
        self.setDaemon(1)
        self._testcase = testcase

    def run(self):
        try:
            self.testrun()
        except Exception:
            s = StringIO()
            traceback.print_exc(file=s)
            self._testcase.fail("Exception in thread %s:\n%s\n" %
                                (self, s.getvalue()))

    def cleanup(self, timeout=15):
        self.join(timeout)
        if self.isAlive():
            self._testcase.fail("Thread did not finish: %s" % self)


=== ZODB4/src/zodb/zeo/tests/commitlock.py 1.7.6.2 => 1.7.6.3 ===
--- ZODB4/src/zodb/zeo/tests/commitlock.py:1.7.6.2	Wed Jun 18 14:22:40 2003
+++ ZODB4/src/zodb/zeo/tests/commitlock.py	Thu Jun 19 11:35:36 2003
@@ -23,7 +23,7 @@
 
 from zodb.zeo.client import ClientStorage
 from zodb.zeo.interfaces import ClientDisconnected
-from zodb.zeo.tests.testthread import TestThread
+from zodb.zeo.tests.basethread import TestThread
 from zodb.zeo.tests.common import DummyDB
 
 


=== ZODB4/src/zodb/zeo/tests/invalid.py 1.1.2.2 => 1.1.2.3 ===
--- ZODB4/src/zodb/zeo/tests/invalid.py:1.1.2.2	Wed Jun 18 11:49:27 2003
+++ ZODB4/src/zodb/zeo/tests/invalid.py	Thu Jun 19 11:35:36 2003
@@ -21,7 +21,7 @@
 from zodb.db import DB
 from zodb.interfaces import ReadConflictError, ConflictError, VersionLockError
 
-from zodb.zeo.tests.testthread import TestThread
+from zodb.zeo.tests.basethread import TestThread
 from zodb.zeo.tests.connection import CommonSetupTearDown
 
 from transaction import get_transaction

=== Removed File ZODB4/src/zodb/zeo/tests/testthread.py ===