Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
4b0ea80d
Commit
4b0ea80d
authored
Feb 27, 2013
by
Marius Gedminas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bite the bullet and deal with Python 3 fat pickles
parent
66cb84d3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
3 deletions
+43
-3
src/ZODB/FileStorage/tests.py
src/ZODB/FileStorage/tests.py
+5
-1
src/ZODB/scripts/tests/test_doc.py
src/ZODB/scripts/tests/test_doc.py
+6
-0
src/ZODB/tests/test_fsdump.py
src/ZODB/tests/test_fsdump.py
+15
-1
src/ZODB/tests/testfsoids.py
src/ZODB/tests/testfsoids.py
+17
-1
No files found.
src/ZODB/FileStorage/tests.py
View file @
4b0ea80d
...
...
@@ -29,7 +29,11 @@ checker = renormalizing.RENormalizing([
(
re
.
compile
(
"ZODB.POSException.POSKeyError"
),
r"POSKeyError"
),
(
re
.
compile
(
"ZODB.FileStorage.FileStorage.FileStorageQuotaError"
),
r"FileStorageQuotaError"
),
])
# Python 3 produces larger pickles, even when we use zodbpickle :(
# this changes all the offsets in iterator.test
(
re
.
compile
(
'data.fs:207766'
),
'data.fs:117080'
),
(
re
.
compile
(
'data.fs:57991'
),
'data.fs:35936'
),
])
def
pack_keep_old
():
"""Should a copy of the database be kept?
...
...
src/ZODB/scripts/tests/test_doc.py
View file @
4b0ea80d
...
...
@@ -26,6 +26,12 @@ checker = zope.testing.renormalizing.RENormalizing([
# Python 3 bytes add a "b".
(
re
.
compile
(
"b('.*?')"
),
r"\1"
),
(
re
.
compile
(
'b(".*?")'
),
r"\1"
),
# Python 3 produces larger pickles, even when we use zodbpickle :(
# this changes all the offsets and sizes in fstail.txt
(
re
.
compile
(
"user='' description='' length=138 offset=190"
),
"user='' description='' length=132 offset=185"
),
(
re
.
compile
(
"user='' description='initial database creation' length=155 offset=52"
),
"user='' description='initial database creation' length=150 offset=52"
),
])
def
test_suite
():
...
...
src/ZODB/tests/test_fsdump.py
View file @
4b0ea80d
...
...
@@ -67,12 +67,26 @@ Clean up.
>>> st.close()
"""
import
re
import
doctest
import
zope.testing.setupstack
import
ZODB.tests.util
from
zope.testing
import
renormalizing
checker
=
renormalizing
.
RENormalizing
([
# Normalizing this makes diffs easier to read
(
re
.
compile
(
r'\btid=[0-9a-f]+\b'
),
'tid=...'
),
(
re
.
compile
(
r'\b\
d
\d\
d
\d-\
d
\d-\
d
\d \
d
\d:\
d
\d:\
d
\d\
.
\d+\b'
),
'...'
),
# Python 3 produces larger pickles, even when we use zodbpickle :(
# this changes all the offsets and sizes
(
re
.
compile
(
r'\bsize=65\b'
),
'size=60'
),
(
re
.
compile
(
r'\
o
ffset=206\b'
),
'offset=201'
),
(
re
.
compile
(
r'\bsize=156\b'
),
'size=107'
),
])
def
test_suite
():
return
doctest
.
DocTestSuite
(
setUp
=
zope
.
testing
.
setupstack
.
setUpDirectory
,
tearDown
=
zope
.
testing
.
setupstack
.
tearDown
,
checker
=
ZODB
.
tests
.
util
.
checker
)
checker
=
ZODB
.
tests
.
util
.
checker
+
checker
)
src/ZODB/tests/testfsoids.py
View file @
4b0ea80d
...
...
@@ -167,8 +167,24 @@ Clean up.
>>> st.cleanup() # remove .fs, .index, etc
"""
import
re
import
doctest
import
ZODB.tests.util
from
zope.testing
import
renormalizing
checker
=
renormalizing
.
RENormalizing
([
# Normalizing this makes diffs easier to read
(
re
.
compile
(
r'\btid 0x[0-9a-f]+\b'
),
'tid 0x...'
),
(
re
.
compile
(
r'\b\
d
\d\
d
\d-\
d
\d-\
d
\d \
d
\d:\
d
\d:\
d
\d\
.
\d+\b'
),
'...'
),
# Python 3 produces larger pickles, even when we use zodbpickle :(
# this changes all the offsets and sizes
(
re
.
compile
(
r'\boffset=167\b'
),
'offset=162'
),
(
re
.
compile
(
r'\boffset=483\b'
),
'offset=429'
),
(
re
.
compile
(
r'(PersistentMapping|OOBTree) at 206\b'
),
r'\1 at 201'
),
(
re
.
compile
(
r'(OOBTree) at 404\b'
),
r'\1 at 350'
),
(
re
.
compile
(
r'(PersistentMapping|OOBTree) at 531\b'
),
r'\1 at 477'
),
])
def
test_suite
():
return
doctest
.
DocTestSuite
(
checker
=
ZODB
.
tests
.
util
.
checker
)
return
doctest
.
DocTestSuite
(
checker
=
ZODB
.
tests
.
util
.
checker
+
checker
)
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