Commit 7b064fc4 authored by Jason Madden's avatar Jason Madden

The value of using64bits was broken in OIBTree with pure python.

Fix it.

Also it's possible to statically know the expected value of using64bits for all included tree modules, so we don't need the (unexecuted) branch that creates (unused) test code in the *I* test modules.
parent 3df50aac
......@@ -42,7 +42,7 @@ from ._compat import import_c_extension
_BUCKET_SIZE = 60
_TREE_SIZE = 250
using64bits = True
using64bits = False
class OIBucketPy(Bucket):
_to_key = _to_key
......
......@@ -23,9 +23,8 @@ from .common import MultiUnion
from .common import NormalSetTests
from .common import SetConflictTestBase
from .common import SetResult
from .common import TestLongIntKeys
from .common import makeBuilder
from BTrees.IIBTree import using64bits #XXX Ugly, but unavoidable
class IFBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -97,26 +96,6 @@ class IFBTreePyTest(BTreeTests, unittest.TestCase):
from BTrees.IFBTree import IFBTreePy
return IFBTreePy()
if using64bits:
class IFBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.IFBTree import IFBTree
return IFBTree()
def getTwoValues(self):
return 0.5, 1.5
class IFBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.IFBTree import IFBTreePy
return IFBTreePy()
def getTwoValues(self):
return 0.5, 1.5
class _TestIFBTreesBase(object):
......
......@@ -24,12 +24,10 @@ 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 BTrees.IIBTree import using64bits #XXX Ugly, but unavoidable
class IIBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -130,29 +128,6 @@ class IIBTreeTestPy(_IIBTreeTestBase, unittest.TestCase):
return IIBTreePy()
if using64bits:
class IIBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.IIBTree import IIBTree
return IIBTree()
def getTwoValues(self):
return 1, 2
class IIBTreeTest(BTreeTests, TestLongIntKeys, TestLongIntValues,
unittest.TestCase):
def _makeOne(self):
from BTrees.IIBTree import IIBTreePy
return IIBTreePy()
def getTwoValues(self):
return 1, 2
class _TestIIBTreesBase(object):
def testNonIntegerKeyRaises(self):
......
......@@ -25,9 +25,8 @@ from .common import NormalSetTests
from .common import SetConflictTestBase
from .common import SetResult
from .common import TypeTest
from .common import TestLongIntKeys
from .common import makeBuilder
from BTrees.IIBTree import using64bits #XXX Ugly, but unavoidable
class IOBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -100,23 +99,6 @@ class IOBTreePyTest(BTreeTests, unittest.TestCase):
return IOBTreePy()
if using64bits:
class IOBTreeTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTree
return IOBTree()
class IOBTreePyTest(BTreeTests, TestLongIntKeys, unittest.TestCase):
def _makeOne(self):
from BTrees.IOBTree import IOBTreePy
return IOBTreePy()
class _TestIOBTreesBase(TypeTest):
def _stringraises(self):
......
......@@ -22,12 +22,11 @@ from .common import ModuleTest
from .common import NormalSetTests
from .common import SetConflictTestBase
from .common import SetResult
from .common import TestLongIntValues
from .common import TypeTest
from .common import Weighted
from .common import itemsToSet
from .common import makeBuilder
from BTrees.OIBTree import using64bits #XXX Ugly, but necessary
class OIBTreeInternalKeyTest(InternalKeysMappingTest, unittest.TestCase):
......@@ -99,23 +98,6 @@ class OIBTreePyTest(BTreeTests, unittest.TestCase):
return OIBTreePy()
if using64bits:
class OIBTreeTest(BTreeTests, TestLongIntValues, unittest.TestCase):
def _makeOne(self):
from BTrees.OIBTree import OIBTree
return OIBTree()
def getTwoKeys(self):
return object(), object()
class OIBTreePyTest(BTreeTests, TestLongIntValues, unittest.TestCase):
def _makeOne(self):
from BTrees.OIBTree import OIBTreePy
return OIBTreePy()
def getTwoKeys(self):
return object(), object()
class _TestOIBTreesBase(TypeTest):
def _stringraises(self):
......
......@@ -6,6 +6,8 @@
- Nothing changed yet.
- Fix the value for ``BTrees.OIBTree.using64bits`` 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