Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
12a1857a
Commit
12a1857a
authored
Dec 10, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moar xrange compat.
parent
1b50c3ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
BTrees/tests/common.py
BTrees/tests/common.py
+7
-0
BTrees/tests/test_OIBTree.py
BTrees/tests/test_OIBTree.py
+1
-0
No files found.
BTrees/tests/common.py
View file @
12a1857a
...
@@ -473,6 +473,7 @@ class MappingBase(Base):
...
@@ -473,6 +473,7 @@ class MappingBase(Base):
# This tests fixes to several bugs in this area, starting with
# This tests fixes to several bugs in this area, starting with
# http://collector.zope.org/Zope/419,
# http://collector.zope.org/Zope/419,
# "BTreeItems slice contains 1 too many elements".
# "BTreeItems slice contains 1 too many elements".
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
for
n
in
range
(
10
):
for
n
in
range
(
10
):
t
.
clear
()
t
.
clear
()
...
@@ -1086,6 +1087,7 @@ class NormalSetTests(Base):
...
@@ -1086,6 +1087,7 @@ class NormalSetTests(Base):
def
testBigInsert
(
self
):
def
testBigInsert
(
self
):
from
.._compat
import
PY2
from
.._compat
import
PY2
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
xrange
(
10000
)
r
=
xrange
(
10000
)
for
x
in
r
:
for
x
in
r
:
...
@@ -1096,6 +1098,7 @@ class NormalSetTests(Base):
...
@@ -1096,6 +1098,7 @@ class NormalSetTests(Base):
self
.
assert_
(
x
in
t
)
self
.
assert_
(
x
in
t
)
def
testRemoveSucceeds
(
self
):
def
testRemoveSucceeds
(
self
):
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
xrange
(
10000
)
r
=
xrange
(
10000
)
for
x
in
r
:
t
.
insert
(
x
)
for
x
in
r
:
t
.
insert
(
x
)
...
@@ -1115,6 +1118,7 @@ class NormalSetTests(Base):
...
@@ -1115,6 +1118,7 @@ class NormalSetTests(Base):
self
.
assert_
(
1
not
in
t
)
self
.
assert_
(
1
not
in
t
)
def
testKeys
(
self
):
def
testKeys
(
self
):
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
xrange
(
1000
)
r
=
xrange
(
1000
)
for
x
in
r
:
for
x
in
r
:
...
@@ -1124,6 +1128,7 @@ class NormalSetTests(Base):
...
@@ -1124,6 +1128,7 @@ class NormalSetTests(Base):
def
testClear
(
self
):
def
testClear
(
self
):
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
xrange
(
1000
)
r
=
xrange
(
1000
)
for
x
in
r
:
t
.
insert
(
x
)
for
x
in
r
:
t
.
insert
(
x
)
...
@@ -1260,12 +1265,14 @@ class NormalSetTests(Base):
...
@@ -1260,12 +1265,14 @@ class NormalSetTests(Base):
class
ExtendedSetTests
(
NormalSetTests
):
class
ExtendedSetTests
(
NormalSetTests
):
def
testLen
(
self
):
def
testLen
(
self
):
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
xrange
(
10000
)
r
=
xrange
(
10000
)
for
x
in
r
:
t
.
insert
(
x
)
for
x
in
r
:
t
.
insert
(
x
)
self
.
assertEqual
(
len
(
t
)
,
10000
,
len
(
t
))
self
.
assertEqual
(
len
(
t
)
,
10000
,
len
(
t
))
def
testGetItem
(
self
):
def
testGetItem
(
self
):
from
.._compat
import
xrange
t
=
self
.
_makeOne
()
t
=
self
.
_makeOne
()
r
=
xrange
(
10000
)
r
=
xrange
(
10000
)
for
x
in
r
:
t
.
insert
(
x
)
for
x
in
r
:
t
.
insert
(
x
)
...
...
BTrees/tests/test_OIBTree.py
View file @
12a1857a
...
@@ -143,6 +143,7 @@ class _TestOIBTreesBase(TypeTest):
...
@@ -143,6 +143,7 @@ class _TestOIBTreesBase(TypeTest):
self
.
_makeOne
()[
1
]
=
None
self
.
_makeOne
()[
1
]
=
None
def
testEmptyFirstBucketReportedByGuido
(
self
):
def
testEmptyFirstBucketReportedByGuido
(
self
):
from
.._compat
import
xrange
b
=
self
.
_makeOne
()
b
=
self
.
_makeOne
()
for
i
in
xrange
(
29972
):
# reduce to 29971 and it works
for
i
in
xrange
(
29972
):
# reduce to 29971 and it works
b
[
i
]
=
i
b
[
i
]
=
i
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment