Commit ba2eef3d authored by Jason Madden's avatar Jason Madden

Error handling improvements.

parent 37382150
......@@ -85,14 +85,14 @@ script:
- python --version
- |
if [[ "$WITH_COVERAGE" == "1" ]]; then
coverage run -m zope.testrunner --test-path=. --auto-color --auto-progress --verbose
python -m coverage run -m zope.testrunner --test-path=. --auto-color --auto-progress --verbose
else
zope-testrunner --test-path=. --auto-color --auto-progress --verbose
python -m zope.testrunner --test-path=. --auto-color --auto-progress --verbose
fi
- python setup.py -q bdist_wheel
after_success:
- if [[ "$WITH_COVERAGE" == "1" ]]; then coveralls; fi
- if [[ "$WITH_COVERAGE" == "1" ]]; then python -m coveralls; fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# macpython 3.5 doesn't support recent TLS protocols which causes twine
......
......@@ -77,7 +77,25 @@ static void PyVar_Assign(PyObject **v, PyObject *e) { Py_XDECREF(*v); *v=e;}
#error "PY_LONG_LONG required but not defined"
#endif
static int
longlong_handle_overflow(PY_LONG_LONG result, int overflow)
{
if (overflow)
{
/* Python 3 tends to have an exception already set, Python 2 not so much */
if (!PyErr_Occurred())
PyErr_SetString(PyExc_OverflowError, "couldn't convert integer to C long long");
return 0;
}
else if (result == -1 && PyErr_Occurred())
/* An exception has already been raised. */
return 0;
return 1;
}
#ifdef NEED_LONG_LONG_KEYS
#if defined(ZODB_UNSIGNED_VALUE_INTS) || defined(ZODB_UNSIGNED_KEY_INTS)
static int
ulonglong_check(PyObject *ob)
......@@ -85,21 +103,25 @@ ulonglong_check(PyObject *ob)
#ifndef PY3K
if (PyInt_Check(ob))
{
long tmp;
tmp = PyInt_AS_LONG(ob);
if (tmp < 0) {
PyErr_SetString(PyExc_OverflowError, "unsigned value less than 0");
return 0;
}
return 1;
long tmp;
tmp = PyInt_AS_LONG(ob);
if (tmp < 0) {
PyErr_SetString(PyExc_OverflowError, "unsigned value less than 0");
return 0;
}
return 1;
}
#endif
if (!PyLong_Check(ob))
return 0;
{
return 0;
}
if (PyLong_AsUnsignedLongLong(ob) == (unsigned long long)-1 && PyErr_Occurred())
return 0;
{
return 0;
}
return 1;
}
#endif /* defined(ZODB_UNSIGNED_VALUE_INTS) || defined(ZODB_UNSIGNED_KEY_INTS) */
......@@ -115,16 +137,11 @@ longlong_check(PyObject *ob)
if (PyLong_Check(ob)) {
int overflow;
(void)PyLong_AsLongLongAndOverflow(ob, &overflow);
if (overflow)
goto overflow;
return 1;
PY_LONG_LONG result;
result = PyLong_AsLongLongAndOverflow(ob, &overflow);
return longlong_handle_overflow(result, overflow);
}
return 0;
overflow:
PyErr_SetString(PyExc_ValueError,
"longlong_check: long integer out of range");
return 0;
}
#endif
......@@ -141,15 +158,17 @@ ulonglong_as_object(unsigned PY_LONG_LONG val)
static int
ulonglong_convert(PyObject *ob, unsigned PY_LONG_LONG *value)
{
unsigned PY_LONG_LONG val;
#ifndef PY3K
if (PyInt_Check(ob))
{
long tmp;
tmp = PyInt_AS_LONG(ob);
if (tmp < 0) {
PyErr_SetString(PyExc_OverflowError, "unsigned value less than 0");
return 0;
}
long tmp;
tmp = PyInt_AS_LONG(ob);
if (tmp < 0) {
PyErr_SetString(PyExc_OverflowError, "unsigned value less than 0");
return 0;
}
(*value) = (unsigned PY_LONG_LONG)tmp;
return 1;
}
......@@ -161,10 +180,9 @@ ulonglong_convert(PyObject *ob, unsigned PY_LONG_LONG *value)
return 0;
}
unsigned PY_LONG_LONG val;
val = PyLong_AsUnsignedLongLong(ob);
if (val == (unsigned long long)-1 && PyErr_Occurred())
return 0;
return 0;
(*value) = val;
return 1;
}
......@@ -181,6 +199,8 @@ longlong_as_object(PY_LONG_LONG val)
static int
longlong_convert(PyObject *ob, PY_LONG_LONG *value)
{
PY_LONG_LONG val;
int overflow;
#ifndef PY3K
if (PyInt_Check(ob))
{
......@@ -194,19 +214,13 @@ longlong_convert(PyObject *ob, PY_LONG_LONG *value)
PyErr_SetString(PyExc_TypeError, "expected integer key");
return 0;
}
else
val = PyLong_AsLongLongAndOverflow(ob, &overflow);
if (!longlong_handle_overflow(val, overflow))
{
PY_LONG_LONG val;
int overflow;
val = PyLong_AsLongLongAndOverflow(ob, &overflow);
if (overflow)
goto overflow;
(*value) = val;
return 1;
return 0;
}
overflow:
PyErr_SetString(PyExc_ValueError, "long integer out of range");
return 0;
(*value) = val;
return 1;
}
#endif /* NEED_LONG_LONG_SUPPORT */
......
......@@ -129,7 +129,7 @@ initSetIteration(SetIteration *i, PyObject *s, int useValues)
#endif
else
{
PyErr_SetString(PyExc_TypeError, "invalid argument");
PyErr_SetString(PyExc_TypeError, "set operation: invalid argument, cannot iterate");
return -1;
}
......@@ -143,7 +143,7 @@ initSetIteration(SetIteration *i, PyObject *s, int useValues)
#endif
static int
copyRemaining(Bucket *r, SetIteration *i, int merge,
copyRemaining(Bucket *r, SetIteration *i, int merge,
/* See comment # 42 */
#ifdef MERGE
......@@ -209,7 +209,7 @@ set_operation(PyObject *s1, PyObject *s2,
difference is one. This works fine in the int value and float value
cases but makes no sense in the object value case. In the object
value case, we don't do merging, so we don't use the weights, so it
doesn't matter what they are.
doesn't matter what they are.
*/
#ifdef MERGE
VALUE_TYPE w1, VALUE_TYPE w2,
......@@ -427,7 +427,7 @@ wunion_m(PyObject *ignored, PyObject *args)
PyObject *o1, *o2;
VALUE_TYPE w1 = 1, w2 = 1;
UNLESS(PyArg_ParseTuple(args, "OO|" VALUE_PARSE VALUE_PARSE,
UNLESS(PyArg_ParseTuple(args, "OO|" VALUE_PARSE VALUE_PARSE,
&o1, &o2, &w1, &w2)
) return NULL;
......@@ -437,7 +437,7 @@ wunion_m(PyObject *ignored, PyObject *args)
return Py_BuildValue(VALUE_PARSE "O", w1, o1);
o1 = set_operation(o1, o2, 1, 1, w1, w2, 1, 1, 1);
if (o1)
if (o1)
ASSIGN(o1, Py_BuildValue(VALUE_PARSE "O", (VALUE_TYPE)1, o1));
return o1;
......@@ -449,7 +449,7 @@ wintersection_m(PyObject *ignored, PyObject *args)
PyObject *o1, *o2;
VALUE_TYPE w1 = 1, w2 = 1;
UNLESS(PyArg_ParseTuple(args, "OO|" VALUE_PARSE VALUE_PARSE,
UNLESS(PyArg_ParseTuple(args, "OO|" VALUE_PARSE VALUE_PARSE,
&o1, &o2, &w1, &w2)
) return NULL;
......
......@@ -1509,12 +1509,14 @@ def to_int(self, v):
return int(v)
# PyPy can raise ValueError converting a negative number to a
# unsigned value.
uint_pack, uint_unpack = _packer_unpacker('I')
def to_uint(self, v):
try:
uint_pack(index(v))
except (struct_error, TypeError):
except (struct_error, TypeError, ValueError):
if isinstance(v, int_types):
raise OverflowError("Value out of range", v)
raise TypeError('non-negative 32-bit integer expected')
......@@ -1548,7 +1550,7 @@ ulong_pack, ulong_unpack = _packer_unpacker('Q')
def to_ulong(self, v):
try:
ulong_pack(index(v))
except (struct_error, TypeError):
except (struct_error, TypeError, ValueError):
if isinstance(v, int_types):
raise OverflowError("Value out of range", v)
raise TypeError('non-negative 64-bit integer expected')
......
......@@ -13,6 +13,7 @@
##############################################################################
from __future__ import division
import sys
import functools
import unittest
import platform
......@@ -1978,13 +1979,13 @@ class TestLongIntKeys(TestLongIntSupport):
assert o1 != o2
# Test some small key values first:
zero_long = self._makeLong(0)
t[zero_long] = o1
self.assertEqual(t[0], o1)
t[0] = o2
self.assertEqual(t[zero_long], o2)
self.assertEqual(list(t.keys()), [0])
self.assertEqual(list(t.keys(None, None)), [0])
one_long = self._makeLong(1)
t[one_long] = o1
self.assertEqual(t[1], o1)
t[1] = o2
self.assertEqual(t[one_long], o2)
self.assertEqual(list(t.keys()), [1])
self.assertEqual(list(t.keys(None, None)), [1])
# Test some large key values too:
k1 = SMALLEST_POSITIVE_33_BITS
......@@ -1996,23 +1997,22 @@ class TestLongIntKeys(TestLongIntSupport):
self.assertEqual(t[k1], o1)
self.assertEqual(t[k2], o2)
self.assertEqual(t[k3], o1)
self.assertEqual(list(t.keys()), [k3, 0, k1, k2])
self.assertEqual(list(t.keys(k3, None)), [k3, 0, k1, k2])
self.assertEqual(list(t.keys(None, k2)), [k3, 0, k1, k2])
self.assertEqual(list(t.keys()), [k3, 1, k1, k2])
self.assertEqual(list(t.keys(k3, None)), [k3, 1, k1, k2])
self.assertEqual(list(t.keys(None, k2)), [k3, 1, k1, k2])
def testLongIntKeysOutOfRange(self):
self._skip_if_not_64bit()
o1, o2 = self.getTwoValues()
t = self._makeOne()
k1 = SMALLEST_POSITIVE_65_BITS if self.SUPPORTS_NEGATIVE_KEYS else 2**64 + 1
with self.assertRaises((OverflowError, ValueError)):
with self.assertRaises(OverflowError):
t[k1] = o1
t = self._makeOne()
with self.assertRaises((OverflowError, ValueError)):
with self.assertRaises(OverflowError):
t[LARGEST_NEGATIVE_65_BITS] = o1
class TestLongIntValues(TestLongIntSupport):
SUPPORTS_NEGATIVE_VALUES = True
def testLongIntValuesWork(self):
......@@ -2038,11 +2038,11 @@ class TestLongIntValues(TestLongIntSupport):
k1, k2 = self.getTwoKeys()
t = self._makeOne()
v1 = SMALLEST_POSITIVE_65_BITS if self.SUPPORTS_NEGATIVE_VALUES else 2**64 + 1
with self.assertRaises((OverflowError, ValueError)):
with self.assertRaises(OverflowError):
t[k1] = v1
t = self._makeOne()
with self.assertRaises((OverflowError, ValueError)):
with self.assertRaises(OverflowError):
t[k1] = LARGEST_NEGATIVE_65_BITS
......
......@@ -442,8 +442,18 @@ class FamilyTest(unittest.TestCase):
BTrees.family32.II, BTrees.IIBTree)
self.assertEqual(
BTrees.family32.IF, BTrees.IFBTree)
self.assertEqual(
BTrees.family32.UO, BTrees.UOBTree)
self.assertEqual(
BTrees.family32.OU, BTrees.OUBTree)
self.assertEqual(
BTrees.family32.UU, BTrees.UUBTree)
self.assertEqual(
BTrees.family32.UF, BTrees.UFBTree)
self.assertEqual(
BTrees.family32.OO, BTrees.OOBTree)
self.assertEqual(
BTrees.family32.OU, BTrees.OUBTree)
s = IOTreeSet()
s.insert(BTrees.family32.maxint)
self.assertTrue(BTrees.family32.maxint in s)
......@@ -474,8 +484,18 @@ class FamilyTest(unittest.TestCase):
BTrees.family64.II, BTrees.LLBTree)
self.assertEqual(
BTrees.family64.IF, BTrees.LFBTree)
self.assertEqual(
BTrees.family64.UO, BTrees.QOBTree)
self.assertEqual(
BTrees.family64.OU, BTrees.OQBTree)
self.assertEqual(
BTrees.family64.UU, BTrees.QQBTree)
self.assertEqual(
BTrees.family64.UF, BTrees.QFBTree)
self.assertEqual(
BTrees.family64.OO, BTrees.OOBTree)
self.assertEqual(
BTrees.family64.OU, BTrees.OQBTree)
s = LOTreeSet()
s.insert(BTrees.family64.maxint)
self.assertTrue(BTrees.family64.maxint in s)
......
......@@ -17,7 +17,6 @@ from .common import UnsignedValuesBTreeTests as BTreeTests
from .common import ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedValuesMappingBase as MappingBase
from .common import UnsignedValuesMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -25,14 +24,12 @@ from .common import MultiUnion
from .common import NormalSetTests
from .common import SetConflictTestBase
from .common import SetResult
from .common import TestLongIntKeys
from .common import TestLongIntValues
from .common import Weighted
from .common import itemsToSet
from .common import makeBuilder
from .common import UnsignedValuesMixin
from .common import UnsignedError
from BTrees.IUBTree import using64bits # XXX Ugly, but unavoidable
# pylint:disable=no-name-in-module,arguments-differ
......@@ -50,20 +47,6 @@ class IUBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return IUBTreePy
class IUTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IUBTree import IUTreeSet
return IUTreeSet
class IUTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.IUBTree import IUTreeSetPy
return IUTreeSetPy
class IUBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -145,29 +128,6 @@ class IUBTreeTestPy(_IUBTreeTestBase, unittest.TestCase):
return IUBTreePy()
if using64bits:
class IUBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.IUBTree import IUBTree
return IUBTree()
def getTwoValues(self):
return 1, 2
class IUBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.IUBTree import IUBTreePy
return IUBTreePy()
def getTwoValues(self):
return 1, 2
class _TestIUBTreesBase(object):
def testNonIntegerKeyRaises(self):
......@@ -467,42 +427,3 @@ class IUModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IIntegerUnsignedBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(IUBTreeInternalKeyTest),
unittest.makeSuite(IUBTreePyInternalKeyTest),
unittest.makeSuite(IUTreeSetInternalKeyTest),
unittest.makeSuite(IUTreeSetPyInternalKeyTest),
unittest.makeSuite(IUBucketTest),
unittest.makeSuite(IUBucketPyTest),
unittest.makeSuite(IUTreeSetTest),
unittest.makeSuite(IUTreeSetPyTest),
unittest.makeSuite(IUSetTest),
unittest.makeSuite(IUSetPyTest),
unittest.makeSuite(IUBTreeTest),
unittest.makeSuite(IUBTreeTestPy),
unittest.makeSuite(TestIUBTrees),
unittest.makeSuite(TestIUBTreesPy),
unittest.makeSuite(TestIUSets),
unittest.makeSuite(TestIUSetsPy),
unittest.makeSuite(TestIUTreeSets),
unittest.makeSuite(TestIUTreeSetsPy),
unittest.makeSuite(TestIUMultiUnion),
unittest.makeSuite(TestIUMultiUnionPy),
unittest.makeSuite(PureIU),
unittest.makeSuite(PureIUPy),
unittest.makeSuite(TestWeightedIU),
unittest.makeSuite(TestWeightedIUPy),
unittest.makeSuite(IUBTreeConflictTests),
unittest.makeSuite(IUBTreeConflictTestsPy),
unittest.makeSuite(IUBucketConflictTests),
unittest.makeSuite(IUBucketConflictTestsPy),
unittest.makeSuite(IUTreeSetConflictTests),
unittest.makeSuite(IUTreeSetConflictTestsPy),
unittest.makeSuite(IUSetConflictTests),
unittest.makeSuite(IUSetConflictTestsPy),
unittest.makeSuite(IUModuleTest),
))
......@@ -17,7 +17,6 @@ from .common import UnsignedValuesBTreeTests as BTreeTests
from .common import ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedValuesMappingBase as MappingBase
from .common import UnsignedValuesMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -48,20 +47,6 @@ class LQBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return LQBTreePy
class LQTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LQBTree import LQTreeSet
return LQTreeSet
class LQTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.LQBTree import LQTreeSetPy
return LQTreeSetPy
class LQBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -379,39 +364,3 @@ class LQModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IIntegerUnsignedBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(LQBTreeInternalKeyTest),
unittest.makeSuite(LQBTreeInternalKeyTest),
unittest.makeSuite(LQTreeSetInternalKeyTest),
unittest.makeSuite(LQTreeSetInternalKeyTest),
unittest.makeSuite(LQBucketTest),
unittest.makeSuite(LQBucketTest),
unittest.makeSuite(LQTreeSetTest),
unittest.makeSuite(LQTreeSetTest),
unittest.makeSuite(LQSetTest),
unittest.makeSuite(LQSetTest),
unittest.makeSuite(LQBTreeTest),
unittest.makeSuite(LQBTreeTest),
unittest.makeSuite(TestLQSets),
unittest.makeSuite(TestLQSets),
unittest.makeSuite(TestLQTreeSets),
unittest.makeSuite(TestLQTreeSets),
unittest.makeSuite(TestLQMultiUnion),
unittest.makeSuite(TestLQMultiUnion),
unittest.makeSuite(PureLQ),
unittest.makeSuite(PureLQ),
unittest.makeSuite(TestWeightedLQ),
unittest.makeSuite(TestWeightedLQ),
unittest.makeSuite(LQBTreeConflictTests),
unittest.makeSuite(LQBTreeConflictTests),
unittest.makeSuite(LQBucketConflictTests),
unittest.makeSuite(LQBucketConflictTests),
unittest.makeSuite(LQTreeSetConflictTests),
unittest.makeSuite(LQTreeSetConflictTests),
unittest.makeSuite(LQSetConflictTests),
unittest.makeSuite(LQSetConflictTests),
unittest.makeSuite(LQModuleTest),
))
......@@ -16,7 +16,6 @@ import unittest
from .common import UnsignedValuesBTreeTests as BTreeTests
from .common import ExtendedSetTests
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedValuesMappingBase as MappingBase
from .common import UnsignedValuesMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -46,20 +45,6 @@ class OQBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return OQBTreePy
class OQTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.OQBTree import OQTreeSet
return OQTreeSet
class OQTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.OQBTree import OQTreeSetPy
return OQTreeSetPy
class OQBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -319,33 +304,3 @@ class OQModuleTest(ModuleTest, unittest.TestCase):
pass
else:
self.fail("OQBTree shouldn't have multiunion")
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(OQBTreeInternalKeyTest),
unittest.makeSuite(OQBTreePyInternalKeyTest),
unittest.makeSuite(OQTreeSetInternalKeyTest),
unittest.makeSuite(OQTreeSetPyInternalKeyTest),
unittest.makeSuite(OQBucketTest),
unittest.makeSuite(OQBucketPyTest),
unittest.makeSuite(OQTreeSetTest),
unittest.makeSuite(OQTreeSetPyTest),
unittest.makeSuite(OQSetTest),
unittest.makeSuite(OQSetPyTest),
unittest.makeSuite(OQBTreeTest),
unittest.makeSuite(OQBTreePyTest),
unittest.makeSuite(PureOQ),
unittest.makeSuite(PureOQPy),
unittest.makeSuite(TestWeightedOQ),
unittest.makeSuite(TestWeightedOQPy),
unittest.makeSuite(OQBucketConflictTests),
unittest.makeSuite(OQBucketPyConflictTests),
unittest.makeSuite(OQSetConflictTests),
unittest.makeSuite(OQSetPyConflictTests),
unittest.makeSuite(OQBTreeConflictTests),
unittest.makeSuite(OQBTreePyConflictTests),
unittest.makeSuite(OQTreeSetConflictTests),
unittest.makeSuite(OQTreeSetPyConflictTests),
unittest.makeSuite(OQModuleTest),
))
......@@ -17,7 +17,6 @@ import unittest
from .common import UnsignedValuesBTreeTests as BTreeTests
from .common import ExtendedSetTests
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedValuesMappingBase as MappingBase
from .common import UnsignedValuesMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -30,7 +29,6 @@ from .common import Weighted
from .common import itemsToSet
from .common import makeBuilder
from .common import UnsignedValuesMixin
from BTrees.IIBTree import using64bits #XXX Ugly, but necessary
class OUBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -47,20 +45,6 @@ class OUBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return OUBTreePy
class OUTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.OUBTree import OUTreeSet
return OUTreeSet
class OUTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.OUBTree import OUTreeSetPy
return OUTreeSetPy
class OUBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -116,23 +100,6 @@ class OUBTreePyTest(BTreeTests, unittest.TestCase):
return OUBTreePy()
if using64bits:
class OUBTreeTest(BTreeTests, TestLongIntValues, unittest.TestCase):
def _makeOne(self):
from BTrees.OUBTree import OUBTree
return OUBTree()
def getTwoKeys(self):
return object(), object()
class OUBTreePyTest(BTreeTests, TestLongIntValues, unittest.TestCase):
def _makeOne(self):
from BTrees.OUBTree import OUBTreePy
return OUBTreePy()
def getTwoKeys(self):
return object(), object()
class _TestOUBTreesBase(TypeTest):
def _stringraises(self):
......@@ -351,35 +318,3 @@ class OUModuleTest(ModuleTest, unittest.TestCase):
pass
else:
self.fail("OUBTree shouldn't have multiunion")
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(OUBTreeInternalKeyTest),
unittest.makeSuite(OUBTreePyInternalKeyTest),
unittest.makeSuite(OUTreeSetInternalKeyTest),
unittest.makeSuite(OUTreeSetPyInternalKeyTest),
unittest.makeSuite(OUBucketTest),
unittest.makeSuite(OUBucketPyTest),
unittest.makeSuite(OUTreeSetTest),
unittest.makeSuite(OUTreeSetPyTest),
unittest.makeSuite(OUSetTest),
unittest.makeSuite(OUSetPyTest),
unittest.makeSuite(OUBTreeTest),
unittest.makeSuite(OUBTreePyTest),
unittest.makeSuite(TestOUBTrees),
unittest.makeSuite(TestOUBTreesPy),
unittest.makeSuite(PureOU),
unittest.makeSuite(PureOUPy),
unittest.makeSuite(TestWeightedOU),
unittest.makeSuite(TestWeightedOUPy),
unittest.makeSuite(OUBucketConflictTests),
unittest.makeSuite(OUBucketConflictTestsPy),
unittest.makeSuite(OUSetConflictTests),
unittest.makeSuite(OUSetConflictTestsPy),
unittest.makeSuite(OUBTreeConflictTests),
unittest.makeSuite(OUBTreeConflictTestsPy),
unittest.makeSuite(OUTreeSetConflictTests),
unittest.makeSuite(OUTreeSetConflictTestsPy),
unittest.makeSuite(OUModuleTest),
))
......@@ -16,7 +16,6 @@ import unittest
from .common import UnsignedKeysBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedKeysMappingBase as MappingBase
from .common import UnsignedKeysMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -44,20 +43,6 @@ class QFBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return QFBTreePy
class QFTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QFBTree import QFTreeSet
return QFTreeSet
class QFTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QFBTree import QFTreeSetPy
return QFTreeSetPy
class QFBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -286,33 +271,3 @@ class QFModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IUnsignedFloatBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(QFBTreeInternalKeyTest),
unittest.makeSuite(QFBTreePyInternalKeyTest),
unittest.makeSuite(QFTreeSetInternalKeyTest),
unittest.makeSuite(QFTreeSetPyInternalKeyTest),
unittest.makeSuite(QFBucketTest),
unittest.makeSuite(QFBucketPyTest),
unittest.makeSuite(QFTreeSetTest),
unittest.makeSuite(QFTreeSetPyTest),
unittest.makeSuite(QFSetTest),
unittest.makeSuite(QFSetPyTest),
unittest.makeSuite(QFBTreeTest),
unittest.makeSuite(QFBTreePyTest),
unittest.makeSuite(TestQFMultiUnion),
unittest.makeSuite(TestQFMultiUnionPy),
unittest.makeSuite(PureQF),
unittest.makeSuite(PureQFPy),
unittest.makeSuite(QFBTreeConflictTests),
unittest.makeSuite(QFBTreeConflictTestsPy),
unittest.makeSuite(QFBucketConflictTests),
unittest.makeSuite(QFBucketConflictTestsPy),
unittest.makeSuite(QFTreeSetConflictTests),
unittest.makeSuite(QFTreeSetConflictTestsPy),
unittest.makeSuite(QFSetConflictTests),
unittest.makeSuite(QFSetConflictTestsPy),
unittest.makeSuite(QFModuleTest),
))
......@@ -21,7 +21,6 @@ from .common import itemsToSet
from .common import UnsignedKeysBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedKeysMappingBase as MappingBase
from .common import UnsignedKeysMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -49,20 +48,6 @@ class QLBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return QLBTreePy
class QLTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QLBTree import QLTreeSet
return QLTreeSet
class QLTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QLBTree import QLTreeSetPy
return QLTreeSetPy
class QLBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -380,39 +365,3 @@ class QLModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IUnsignedIntegerBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(QLBTreeInternalKeyTest),
unittest.makeSuite(QLBTreeInternalKeyTest),
unittest.makeSuite(QLTreeSetInternalKeyTest),
unittest.makeSuite(QLTreeSetInternalKeyTest),
unittest.makeSuite(QLBucketTest),
unittest.makeSuite(QLBucketTest),
unittest.makeSuite(QLTreeSetTest),
unittest.makeSuite(QLTreeSetTest),
unittest.makeSuite(QLSetTest),
unittest.makeSuite(QLSetTest),
unittest.makeSuite(QLBTreeTest),
unittest.makeSuite(QLBTreeTest),
unittest.makeSuite(TestQLSets),
unittest.makeSuite(TestQLSets),
unittest.makeSuite(TestQLTreeSets),
unittest.makeSuite(TestQLTreeSets),
unittest.makeSuite(TestQLMultiUnion),
unittest.makeSuite(TestQLMultiUnion),
unittest.makeSuite(PureQL),
unittest.makeSuite(PureQL),
unittest.makeSuite(TestWeightedQL),
unittest.makeSuite(TestWeightedQL),
unittest.makeSuite(QLBTreeConflictTests),
unittest.makeSuite(QLBTreeConflictTests),
unittest.makeSuite(QLBucketConflictTests),
unittest.makeSuite(QLBucketConflictTests),
unittest.makeSuite(QLTreeSetConflictTests),
unittest.makeSuite(QLTreeSetConflictTests),
unittest.makeSuite(QLSetConflictTests),
unittest.makeSuite(QLSetConflictTests),
unittest.makeSuite(QLModuleTest),
))
......@@ -17,7 +17,6 @@ from .common import UnsignedKeysBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedKeysMappingBase as MappingBase
from .common import UnsignedKeysMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -45,20 +44,6 @@ class QOBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return QOBTreePy
class QOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QOBTree import QOTreeSet
return QOTreeSet
class QOTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QOBTree import QOTreeSetPy
return QOTreeSetPy
class QOBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -325,37 +310,3 @@ class QOModuleTest(ModuleTest, unittest.TestCase):
pass
else:
self.fail("QOBTree shouldn't have weightedIntersection")
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(QOBTreeInternalKeyTest),
unittest.makeSuite(QOBTreePyInternalKeyTest),
unittest.makeSuite(QOTreeSetInternalKeyTest),
unittest.makeSuite(QOTreeSetPyInternalKeyTest),
unittest.makeSuite(QOBucketTest),
unittest.makeSuite(QOBucketPyTest),
unittest.makeSuite(QOTreeSetTest),
unittest.makeSuite(QOTreeSetPyTest),
unittest.makeSuite(QOSetTest),
unittest.makeSuite(QOSetPyTest),
unittest.makeSuite(QOBTreeTest),
unittest.makeSuite(QOBTreePyTest),
unittest.makeSuite(TestQOSets),
unittest.makeSuite(TestQOSetsPy),
unittest.makeSuite(TestQOTreeSets),
unittest.makeSuite(TestQOTreeSetsPy),
unittest.makeSuite(TestQOMultiUnion),
unittest.makeSuite(TestQOMultiUnionPy),
unittest.makeSuite(PureQO),
unittest.makeSuite(PureQOPy),
unittest.makeSuite(QOBTreeConflictTests),
unittest.makeSuite(QOBTreeConflictTestsPy),
unittest.makeSuite(QOBucketConflictTests),
unittest.makeSuite(QOBucketConflictTestsPy),
unittest.makeSuite(QOTreeSetConflictTests),
unittest.makeSuite(QOTreeSetConflictTestsPy),
unittest.makeSuite(QOSetConflictTests),
unittest.makeSuite(QOSetConflictTestsPy),
unittest.makeSuite(QOModuleTest),
))
......@@ -18,7 +18,6 @@ from .common import UnsignedBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedMappingBase as MappingBase
from .common import UnsignedMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -50,20 +49,6 @@ class QQBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return QQBTreePy
class QQTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QQBTree import QQTreeSet
return QQTreeSet
class QQTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.QQBTree import QQTreeSetPy
return QQTreeSetPy
class QQBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -381,39 +366,3 @@ class QQModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IUnsignedUnsignedBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(QQBTreeInternalKeyTest),
unittest.makeSuite(QQBTreeInternalKeyTest),
unittest.makeSuite(QQTreeSetInternalKeyTest),
unittest.makeSuite(QQTreeSetInternalKeyTest),
unittest.makeSuite(QQBucketTest),
unittest.makeSuite(QQBucketTest),
unittest.makeSuite(QQTreeSetTest),
unittest.makeSuite(QQTreeSetTest),
unittest.makeSuite(QQSetTest),
unittest.makeSuite(QQSetTest),
unittest.makeSuite(QQBTreeTest),
unittest.makeSuite(QQBTreeTest),
unittest.makeSuite(TestQQSets),
unittest.makeSuite(TestQQSets),
unittest.makeSuite(TestQQTreeSets),
unittest.makeSuite(TestQQTreeSets),
unittest.makeSuite(TestQQMultiUnion),
unittest.makeSuite(TestQQMultiUnion),
unittest.makeSuite(PureQQ),
unittest.makeSuite(PureQQ),
unittest.makeSuite(TestWeightedQQ),
unittest.makeSuite(TestWeightedQQPy),
unittest.makeSuite(QQBTreeConflictTests),
unittest.makeSuite(QQBTreeConflictTests),
unittest.makeSuite(QQBucketConflictTests),
unittest.makeSuite(QQBucketConflictTests),
unittest.makeSuite(QQTreeSetConflictTests),
unittest.makeSuite(QQTreeSetConflictTests),
unittest.makeSuite(QQSetConflictTests),
unittest.makeSuite(QQSetConflictTests),
unittest.makeSuite(QQModuleTest),
))
......@@ -16,7 +16,6 @@ import unittest
from .common import UnsignedKeysBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedKeysMappingBase as MappingBase
from .common import UnsignedKeysMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -24,10 +23,9 @@ from .common import MultiUnion
from .common import UnsignedNormalSetTests as NormalSetTests
from .common import UnsignedSetConflictTestBase as SetConflictTestBase
from .common import SetResult
from .common import TestLongIntKeys
from .common import makeBuilder
from .common import UnsignedKeysMixin
from BTrees.IIBTree import using64bits #XXX Ugly, but unavoidable
# pylint:disable=no-name-in-module,arguments-differ
......@@ -45,20 +43,6 @@ class UFBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return UFBTreePy
class UFTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UFBTree import UFTreeSet
return UFTreeSet
class UFTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UFBTree import UFTreeSetPy
return UFTreeSetPy
class UFBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -114,26 +98,6 @@ class UFBTreePyTest(BTreeTests, unittest.TestCase):
from BTrees.UFBTree import UFBTreePy
return UFBTreePy()
if using64bits:
class UFBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.UFBTree import UFBTree
return UFBTree()
def getTwoValues(self):
return 0.5, 1.5
class UFBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.UFBTree import UFBTreePy
return UFBTreePy()
def getTwoValues(self):
return 0.5, 1.5
class _TestUFBTreesBase(object):
......@@ -347,34 +311,3 @@ class UFModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IUnsignedFloatBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(UFBTreeInternalKeyTest),
unittest.makeSuite(UFBTreePyInternalKeyTest),
unittest.makeSuite(UFTreeSetInternalKeyTest),
unittest.makeSuite(UFTreeSetPyInternalKeyTest),
unittest.makeSuite(UFBucketTest),
unittest.makeSuite(UFBucketPyTest),
unittest.makeSuite(UFTreeSetTest),
unittest.makeSuite(UFTreeSetPyTest),
unittest.makeSuite(UFSetTest),
unittest.makeSuite(UFSetPyTest),
unittest.makeSuite(UFBTreeTest),
unittest.makeSuite(UFBTreePyTest),
unittest.makeSuite(TestUFBTrees),
unittest.makeSuite(TestUFBTreesPy),
unittest.makeSuite(TestUFMultiUnion),
unittest.makeSuite(TestUFMultiUnionPy),
unittest.makeSuite(PureUF),
unittest.makeSuite(PureUFPy),
unittest.makeSuite(UFBTreeConflictTests),
unittest.makeSuite(UFBTreePyConflictTests),
unittest.makeSuite(UFBucketConflictTests),
unittest.makeSuite(UFBucketPyConflictTests),
unittest.makeSuite(UFTreeSetConflictTests),
unittest.makeSuite(UFTreeSetPyConflictTests),
unittest.makeSuite(UFSetConflictTests),
unittest.makeSuite(UFSetPyConflictTests),
unittest.makeSuite(UFModuleTest),
))
......@@ -17,7 +17,6 @@ from .common import UnsignedKeysBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedKeysMappingBase as MappingBase
from .common import UnsignedKeysMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -25,14 +24,12 @@ from .common import MultiUnion
from .common import UnsignedNormalSetTests as NormalSetTests
from .common import UnsignedSetConflictTestBase as SetConflictTestBase
from .common import SetResult
from .common import TestLongIntKeys
from .common import TestLongIntValues
from .common import Weighted
from .common import itemsToSet
from .common import makeBuilder
from .common import UnsignedKeysMixin
from .common import UnsignedError
from BTrees.UIBTree import using64bits #XXX Ugly, but unavoidable
# pylint:disable=no-name-in-module,arguments-differ
......@@ -51,20 +48,6 @@ class UIBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return UIBTreePy
class UITreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UIBTree import UITreeSet
return UITreeSet
class UITreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UIBTree import UITreeSetPy
return UITreeSetPy
class UIBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -153,29 +136,6 @@ class UIBTreeTestPy(_UIBTreeTestBase, unittest.TestCase):
return UIBTreePy()
if using64bits:
class UIBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.UIBTree import UIBTree
return UIBTree()
def getTwoValues(self):
return 1, 2
class UIBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.UIBTree import UIBTreePy
return UIBTreePy()
def getTwoValues(self):
return 1, 2
class _TestUIBTreesBase(object):
def testNonIntegerKeyRaises(self):
......@@ -475,42 +435,3 @@ class UIModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IUnsignedIntegerBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(UIBTreeInternalKeyTest),
unittest.makeSuite(UIBTreePyInternalKeyTest),
unittest.makeSuite(UITreeSetInternalKeyTest),
unittest.makeSuite(UITreeSetPyInternalKeyTest),
unittest.makeSuite(UIBucketTest),
unittest.makeSuite(UIBucketPyTest),
unittest.makeSuite(UITreeSetTest),
unittest.makeSuite(UITreeSetPyTest),
unittest.makeSuite(UISetTest),
unittest.makeSuite(UISetPyTest),
unittest.makeSuite(UIBTreeTest),
unittest.makeSuite(UIBTreeTestPy),
unittest.makeSuite(TestUIBTrees),
unittest.makeSuite(TestUIBTreesPy),
unittest.makeSuite(TestUISets),
unittest.makeSuite(TestUISetsPy),
unittest.makeSuite(TestUITreeSets),
unittest.makeSuite(TestUITreeSetsPy),
unittest.makeSuite(TestUIMultiUnion),
unittest.makeSuite(TestUIMultiUnionPy),
unittest.makeSuite(PureUI),
unittest.makeSuite(PureUIPy),
unittest.makeSuite(TestWeightedUI),
unittest.makeSuite(TestWeightedUIPy),
unittest.makeSuite(UIBTreeConflictTests),
unittest.makeSuite(UIBTreeConflictTestsPy),
unittest.makeSuite(UIBucketConflictTests),
unittest.makeSuite(UIBucketConflictTestsPy),
unittest.makeSuite(UITreeSetConflictTests),
unittest.makeSuite(UITreeSetConflictTestsPy),
unittest.makeSuite(UISetConflictTests),
unittest.makeSuite(UISetConflictTestsPy),
unittest.makeSuite(UIModuleTest),
))
......@@ -17,7 +17,6 @@ from .common import UnsignedKeysBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedKeysMappingBase as MappingBase
from .common import UnsignedKeysMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -30,7 +29,7 @@ from .common import TestLongIntKeys
from .common import makeBuilder
from .common import UnsignedKeysMixin
from .common import UnsignedError
from BTrees.UOBTree import using64bits #XXX Ugly, but unavoidable
# pylint:disable=no-name-in-module,arguments-differ
......@@ -48,20 +47,6 @@ class UOBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return UOBTreePy
class UOTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UOBTree import UOTreeSet
return UOTreeSet
class UOTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UOBTree import UOTreeSetPy
return UOTreeSetPy
class UOBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -118,23 +103,6 @@ class UOBTreePyTest(BTreeTests, unittest.TestCase):
return UOBTreePy()
if using64bits:
class UOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.UOBTree import UOBTree
return UOBTree()
class UOBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.UOBTree import UOBTreePy
return UOBTreePy()
class _TestUOBTreesBase(TypeTest):
def _stringraises(self):
......@@ -379,39 +347,3 @@ class UOModuleTest(ModuleTest, unittest.TestCase):
pass
else:
self.fail("UOBTree shouldn't have weightedIntersection")
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(UOBTreeInternalKeyTest),
unittest.makeSuite(UOBTreePyInternalKeyTest),
unittest.makeSuite(UOTreeSetInternalKeyTest),
unittest.makeSuite(UOTreeSetPyInternalKeyTest),
unittest.makeSuite(UOBucketTest),
unittest.makeSuite(UOBucketPyTest),
unittest.makeSuite(UOTreeSetTest),
unittest.makeSuite(UOTreeSetPyTest),
unittest.makeSuite(UOSetTest),
unittest.makeSuite(UOSetPyTest),
unittest.makeSuite(UOBTreeTest),
unittest.makeSuite(UOBTreePyTest),
unittest.makeSuite(TestUOBTrees),
unittest.makeSuite(TestUOBTreesPy),
unittest.makeSuite(TestUOSets),
unittest.makeSuite(TestUOSetsPy),
unittest.makeSuite(TestUOTreeSets),
unittest.makeSuite(TestUOTreeSetsPy),
unittest.makeSuite(TestUOMultiUnion),
unittest.makeSuite(TestUOMultiUnionPy),
unittest.makeSuite(PureUO),
unittest.makeSuite(PureUOPy),
unittest.makeSuite(UOBTreeConflictTests),
unittest.makeSuite(UOBTreeConflictTestsPy),
unittest.makeSuite(UOBucketConflictTests),
unittest.makeSuite(UOBucketConflictTestsPy),
unittest.makeSuite(UOTreeSetConflictTests),
unittest.makeSuite(UOTreeSetConflictTestsPy),
unittest.makeSuite(UOSetConflictTests),
unittest.makeSuite(UOSetConflictTestsPy),
unittest.makeSuite(UOModuleTest),
))
......@@ -17,7 +17,6 @@ from .common import UnsignedBTreeTests as BTreeTests
from .common import UnsignedExtendedSetTests as ExtendedSetTests
from .common import I_SetsBase
from .common import InternalKeysMappingTest
from .common import InternalKeysSetTest
from .common import UnsignedMappingBase as MappingBase
from .common import UnsignedMappingConflictTestBase as MappingConflictTestBase
from .common import ModuleTest
......@@ -32,7 +31,7 @@ from .common import itemsToSet
from .common import makeBuilder
from .common import UnsignedMixin
from .common import UnsignedError
from BTrees.UUBTree import using64bits #XXX Ugly, but unavoidable
class UUBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -49,20 +48,6 @@ class UUBTreePyInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
return UUBTreePy
class UUTreeSetInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UUBTree import UUTreeSet
return UUTreeSet
class UUTreeSetPyInternalKeyTest(InternalKeysSetTest, unittest.TestCase):
def _getTargetClass(self):
from BTrees.UUBTree import UUTreeSetPy
return UUTreeSetPy
class UUBucketTest(MappingBase, unittest.TestCase):
def _getTargetClass(self):
......@@ -146,29 +131,6 @@ class UUBTreeTestPy(_UUBTreeTestBase, unittest.TestCase):
return UUBTreePy()
if using64bits:
class UUBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.UUBTree import UUBTree
return UUBTree()
def getTwoValues(self):
return 1, 2
class UUBTreeTestPy(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.UUBTree import UUBTreePy
return UUBTreePy()
def getTwoValues(self):
return 1, 2
class _TestUUBTreesBase(object):
def testNonIntegerKeyRaises(self):
......@@ -468,42 +430,3 @@ class UUModuleTest(ModuleTest, unittest.TestCase):
def _getInterface(self):
import BTrees.Interfaces
return BTrees.Interfaces.IUnsignedUnsignedBTreeModule
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(UUBTreeInternalKeyTest),
unittest.makeSuite(UUBTreePyInternalKeyTest),
unittest.makeSuite(UUTreeSetInternalKeyTest),
unittest.makeSuite(UUTreeSetPyInternalKeyTest),
unittest.makeSuite(UUBucketTest),
unittest.makeSuite(UUBucketPyTest),
unittest.makeSuite(UUTreeSetTest),
unittest.makeSuite(UUTreeSetPyTest),
unittest.makeSuite(UUSetTest),
unittest.makeSuite(UUSetPyTest),
unittest.makeSuite(UUBTreeTest),
unittest.makeSuite(UUBTreeTestPy),
unittest.makeSuite(TestUUBTrees),
unittest.makeSuite(TestUUBTreesPy),
unittest.makeSuite(TestUUSets),
unittest.makeSuite(TestUUSetsPy),
unittest.makeSuite(TestUUTreeSets),
unittest.makeSuite(TestUUTreeSetsPy),
unittest.makeSuite(TestUUMultiUnion),
unittest.makeSuite(TestUUMultiUnionPy),
unittest.makeSuite(PureUU),
unittest.makeSuite(PureUUPy),
unittest.makeSuite(TestWeightedUU),
unittest.makeSuite(TestWeightedUUPy),
unittest.makeSuite(UUBTreeConflictTests),
unittest.makeSuite(UUBTreeConflictTestsPy),
unittest.makeSuite(UUBucketConflictTests),
unittest.makeSuite(UUBucketConflictTestsPy),
unittest.makeSuite(UUTreeSetConflictTests),
unittest.makeSuite(UUTreeSetConflictTestsPy),
unittest.makeSuite(UUSetConflictTests),
unittest.makeSuite(UUSetConflictTestsPy),
unittest.makeSuite(UUModuleTest),
))
......@@ -13,6 +13,13 @@
- Fix the value for ``BTrees.OIBTree.using64bits`` when using the pure Python
implementation (PyPy and when ``PURE_PYTHON`` is in the environment).
- Make the errors that are raised when values are out of range more
consistent between Python 2 and Python 3 and between 32-bit and
64-bit variants.
- Fix the value for ``BTrees.OIBTree`` when using the pure Python
implementation (PyPy and when ``PURE_PYTHON`` is in the environment).
4.6.1 (2019-11-07)
==================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment