summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-01-28 17:20:44 (GMT)
committerBarry Warsaw <barry@python.org>2003-01-28 17:20:44 (GMT)
commitf71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c (patch)
treeb31170225a2c763246014d72e4d5db8b31fc5354 /Lib/bsddb/test
parenta6ae9a2128a85301ded9381c181539720ce82ca0 (diff)
downloadcpython-f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c.zip
cpython-f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c.tar.gz
cpython-f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c.tar.bz2
Everything worked in both the distutils distro and in Python 2.3cvs,
so merge from the bsddb-bsddb3-schizo-branch back to the trunk.
Diffstat (limited to 'Lib/bsddb/test')
-rw-r--r--Lib/bsddb/test/test_all.py7
-rw-r--r--Lib/bsddb/test/test_associate.py7
-rw-r--r--Lib/bsddb/test/test_basics.py7
-rw-r--r--Lib/bsddb/test/test_compat.py9
-rw-r--r--Lib/bsddb/test/test_dbobj.py7
-rw-r--r--Lib/bsddb/test/test_dbshelve.py7
-rw-r--r--Lib/bsddb/test/test_dbtables.py7
-rw-r--r--Lib/bsddb/test/test_env_close.py7
-rw-r--r--Lib/bsddb/test/test_get_none.py7
-rw-r--r--Lib/bsddb/test/test_lock.py7
-rw-r--r--Lib/bsddb/test/test_misc.py8
-rw-r--r--Lib/bsddb/test/test_queue.py7
-rw-r--r--Lib/bsddb/test/test_recno.py8
-rw-r--r--Lib/bsddb/test/test_thread.py9
14 files changed, 88 insertions, 16 deletions
diff --git a/Lib/bsddb/test/test_all.py b/Lib/bsddb/test/test_all.py
index 15b310f..358f5d1 100644
--- a/Lib/bsddb/test/test_all.py
+++ b/Lib/bsddb/test/test_all.py
@@ -16,7 +16,12 @@ if 'silent' in sys.argv: # take care of old flag, just in case
def print_versions():
- from bsddb import db
+ try:
+ # For Python 2.3
+ from bsddb import db
+ except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
print
print '-=' * 38
print db.DB_VERSION_STRING
diff --git a/Lib/bsddb/test/test_associate.py b/Lib/bsddb/test/test_associate.py
index 7f1df83..3061e45 100644
--- a/Lib/bsddb/test/test_associate.py
+++ b/Lib/bsddb/test/test_associate.py
@@ -16,7 +16,12 @@ except ImportError:
import unittest
from test_all import verbose
-from bsddb import db, dbshelve
+try:
+ # For Python 2.3
+ from bsddb import db, dbshelve
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbshelve
#----------------------------------------------------------------------
diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py
index 25cc77c..224aef4 100644
--- a/Lib/bsddb/test/test_basics.py
+++ b/Lib/bsddb/test/test_basics.py
@@ -12,7 +12,12 @@ import tempfile
from pprint import pprint
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_compat.py b/Lib/bsddb/test/test_compat.py
index 862ec74..26b80cf0 100644
--- a/Lib/bsddb/test/test_compat.py
+++ b/Lib/bsddb/test/test_compat.py
@@ -4,13 +4,18 @@ regression test suite.
"""
import sys, os, string
-from bsddb import hashopen, btopen, rnopen
import bsddb
import unittest
import tempfile
from test_all import verbose
+try:
+ # For Python 2.3
+ from bsddb import db, hashopen, btopen, rnopen
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, hashopen, btopen, rnopen
class CompatibilityTestCase(unittest.TestCase):
@@ -126,7 +131,7 @@ class CompatibilityTestCase(unittest.TestCase):
if verbose: print "truth test: true"
else:
if verbose: print "truth test: false"
- except bsddb.error:
+ except db.DBError:
pass
else:
self.fail("Exception expected")
diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py
index 1e1ac27..93ea7ba 100644
--- a/Lib/bsddb/test/test_dbobj.py
+++ b/Lib/bsddb/test/test_dbobj.py
@@ -3,7 +3,12 @@ import sys, os, string
import unittest
import glob
-from bsddb import db, dbobj
+try:
+ # For Python 2.3
+ from bsddb import db, dbobj
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbobj
#----------------------------------------------------------------------
diff --git a/Lib/bsddb/test/test_dbshelve.py b/Lib/bsddb/test/test_dbshelve.py
index 900ec8e..7491cb7 100644
--- a/Lib/bsddb/test/test_dbshelve.py
+++ b/Lib/bsddb/test/test_dbshelve.py
@@ -8,7 +8,12 @@ from pprint import pprint
from types import *
import unittest
-from bsddb import dbshelve, db
+try:
+ # For Python 2.3
+ from bsddb import db, dbshelve
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbshelve
from test_all import verbose
diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py
index a250cf8..685b08d 100644
--- a/Lib/bsddb/test/test_dbtables.py
+++ b/Lib/bsddb/test/test_dbtables.py
@@ -30,7 +30,12 @@ except ImportError:
import unittest
from test_all import verbose
-from bsddb import db, dbtables
+try:
+ # For Python 2.3
+ from bsddb import db, dbtables
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbtables
diff --git a/Lib/bsddb/test/test_env_close.py b/Lib/bsddb/test/test_env_close.py
index 0b46ee3..105be44 100644
--- a/Lib/bsddb/test/test_env_close.py
+++ b/Lib/bsddb/test/test_env_close.py
@@ -8,7 +8,12 @@ import tempfile
import glob
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_get_none.py b/Lib/bsddb/test/test_get_none.py
index 211717b..40b224e 100644
--- a/Lib/bsddb/test/test_get_none.py
+++ b/Lib/bsddb/test/test_get_none.py
@@ -7,7 +7,12 @@ import tempfile
from pprint import pprint
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py
index 337a898..af10bea 100644
--- a/Lib/bsddb/test/test_lock.py
+++ b/Lib/bsddb/test/test_lock.py
@@ -18,7 +18,12 @@ except ImportError:
import unittest
from test_all import verbose
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
#----------------------------------------------------------------------
diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py
index 24c3fc6..7f7a6ee 100644
--- a/Lib/bsddb/test/test_misc.py
+++ b/Lib/bsddb/test/test_misc.py
@@ -5,8 +5,12 @@ import os
import sys
import unittest
-from bsddb import db
-from bsddb import dbshelve
+try:
+ # For Python 2.3
+ from bsddb import db, dbshelve
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbshelve
from test.test_support import verbose
diff --git a/Lib/bsddb/test/test_queue.py b/Lib/bsddb/test/test_queue.py
index e651193..24b86cb 100644
--- a/Lib/bsddb/test/test_queue.py
+++ b/Lib/bsddb/test/test_queue.py
@@ -7,7 +7,12 @@ import tempfile
from pprint import pprint
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py
index ffdb76b..3e517c1 100644
--- a/Lib/bsddb/test/test_recno.py
+++ b/Lib/bsddb/test/test_recno.py
@@ -8,9 +8,15 @@ import tempfile
from pprint import pprint
import unittest
-from bsddb import db
from test_all import verbose
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
+
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
diff --git a/Lib/bsddb/test/test_thread.py b/Lib/bsddb/test/test_thread.py
index 14f8d26..48e8c9a 100644
--- a/Lib/bsddb/test/test_thread.py
+++ b/Lib/bsddb/test/test_thread.py
@@ -26,7 +26,14 @@ except ImportError:
import unittest
from test_all import verbose
-from bsddb import db, dbutils
+
+try:
+ # For Python 2.3
+ from bsddb import db, dbutils
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbutils
+
#----------------------------------------------------------------------