[Zodb-checkins] CVS: ZODB4/src/zodb/zeo/tests - multi.py:1.3 stress.py:1.3
Barry Warsaw
barry@wooz.org
Thu, 13 Mar 2003 17:12:07 -0500
Update of /cvs-repository/ZODB4/src/zodb/zeo/tests
In directory cvs.zope.org:/tmp/cvs-serv922/src/zodb/zeo/tests
Modified Files:
multi.py stress.py
Log Message:
Eradicate the types module in ZODB (where possible). Also normalize
on isinstance() instead of type comparisons.
=== ZODB4/src/zodb/zeo/tests/multi.py 1.2 => 1.3 ===
--- ZODB4/src/zodb/zeo/tests/multi.py:1.2 Wed Dec 25 09:12:22 2002
+++ ZODB4/src/zodb/zeo/tests/multi.py Thu Mar 13 17:11:36 2003
@@ -25,7 +25,6 @@
import os
import tempfile
import time
-import types
VERBOSE = 1
CLIENTS = 4
@@ -138,8 +137,8 @@
for i in range(CLIENTS):
pids.append(start_client(addr, client_func))
for pid in pids:
- assert type(pid) == types.IntType, "invalid pid type: %s (%s)" % \
- (repr(pid), type(pid))
+ assert isinstance(pid, int), "invalid pid type: %s (%s)" % (
+ repr(pid), type(pid))
try:
if VERBOSE:
print "waitpid(%s)" % repr(pid)
=== ZODB4/src/zodb/zeo/tests/stress.py 1.2 => 1.3 ===
--- ZODB4/src/zodb/zeo/tests/stress.py:1.2 Wed Dec 25 09:12:22 2002
+++ ZODB4/src/zodb/zeo/tests/stress.py Thu Mar 13 17:11:36 2003
@@ -29,7 +29,6 @@
import os
import random
import sys
-import types
NUM_TRANSACTIONS_PER_CONN = 10
NUM_CONNECTIONS = 10
@@ -71,7 +70,7 @@
root = cn.root()
obj = random.choice(root.values())
# walk down to the bottom
- while not isinstance(obj.value, types.StringType):
+ while not isinstance(obj.value, str):
obj = obj.value
obj.value = an_object()
get_transaction().commit()